summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2007-09-19 17:06:42 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2007-09-19 17:06:42 (GMT)
commitafb4f8e6bea0ddc503741488daaa0435a26d7396 (patch)
tree7cf02aed852f7ee48fbb2385b7f990749ed8c59d
parent5db57549f365d1ac9b62a484f838c5e9d4813e72 (diff)
downloadperl-Kolab-afb4f8e6bea0ddc503741488daaa0435a26d7396.tar.gz
Determine connect_addr and use it for connecting to Kolab services.
-rw-r--r--Kolab-Cyrus/Cyrus.pm2
-rw-r--r--Kolab/Kolab.pm.in8
2 files changed, 9 insertions, 1 deletions
diff --git a/Kolab-Cyrus/Cyrus.pm b/Kolab-Cyrus/Cyrus.pm
index c9a3918..dd31154 100644
--- a/Kolab-Cyrus/Cyrus.pm
+++ b/Kolab-Cyrus/Cyrus.pm
@@ -53,7 +53,7 @@ sub create
{
Kolab::log('Y', 'Connecting to local Cyrus admin interface');
- my $cyrus = Cyrus::IMAP::Admin->new('localhost');
+ my $cyrus = Cyrus::IMAP::Admin->new($Kolab::config{'connect_addr'});
if (!$cyrus) {
Kolab::log('Y', 'Unable to connect to local Cyrus admin interface', KOLAB_ERROR);
diff --git a/Kolab/Kolab.pm.in b/Kolab/Kolab.pm.in
index ee925b3..7d58778 100644
--- a/Kolab/Kolab.pm.in
+++ b/Kolab/Kolab.pm.in
@@ -228,6 +228,14 @@ sub reloadConfig
$config{'fqdn'} = trim(`hostname`);
+ # connect to services at local address if binding to any interface,
+ # otherwise use the address specified for the public interface.
+ if ($config{'bind_any'} =~ /true/i) {
+ $config{'connect_addr'} = $config{'local_addr'};
+ } else {
+ $config{'connect_addr'} = $config{'bind_addr'};
+ }
+
# Cyrus admin account
$tempval = $config{'cyrus-admins'} || 'manager';
(my $cmanager, my $dummy) = split(/ /, $tempval, 2);