thomas: server/kolabconf/lib/Kolab Conf.pm,1.9,1.10
cvs at kolab.org
cvs at kolab.org
Mon Oct 8 17:38:07 CEST 2007
Author: thomas
Update of /kolabrepository/server/kolabconf/lib/Kolab
In directory doto:/tmp/cvs-serv17804/kolabconf/lib/Kolab
Modified Files:
Conf.pm
Log Message:
Make cyrus configs use local_addr setting
Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/kolabconf/lib/Kolab/Conf.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Conf.pm 6 Sep 2007 10:06:08 -0000 1.9
+++ Conf.pm 8 Oct 2007 15:38:05 -0000 1.10
@@ -43,7 +43,6 @@
our %EXPORT_TAGS = (
'all' => [ qw(
&buildPostfixTransportMap
- &buildCyrusConfig
&buildCyrusGroups
&buildLDAPReplicas
&rebuildTemplates
@@ -96,7 +95,6 @@
"$templatedir/transport.template" => 1,
"$templatedir/virtual.template" => 1,
"$templatedir/imapd.group.template" => 1,
- "$templatedir/cyrus.conf.template" => 1,
"$templatedir/slapd.access.template" => 1,
"$templatedir/slapd.replicas.template" => 1
);
@@ -343,87 +341,6 @@
Kolab::log('T', 'Finished building Postfix $map map', KOLAB_DEBUG);
}
-sub buildCyrusConfig
-{
- Kolab::log('T', 'Building Cyrus config', KOLAB_DEBUG);
-
- my $templatedir = $Kolab::config{"templatedir"};
-
- my $keytemplate = "$templatedir/cyrus.conf.template";
- my $cfg = $templates{$keytemplate};
- my $imapdtemplate = "$templatedir/imapd.conf.template";
- my $imapdcfg = $templates{$imapdtemplate};
- my $oldcfg = $cfg . '.old';
- #delete $templates{$keytemplate};
-
- #my $oldmask = umask 077;
- #copy($cfg, $oldcfg);
- #chown($Kolab::config{'kolab_uid'}, $Kolab::config{'kolab_gid'}, $oldcfg);
- #umask $oldmask;
-
- my $cyrusconf;
- my $cyrustemplate;
- if (!($cyrustemplate = IO::File->new($keytemplate, 'r'))) {
- Kolab::log('T', "Unable to open configuration file `$keytemplate': $!", KOLAB_ERROR);
- exit(1);
- }
-
- if (!($cyrusconf = IO::File->new($cfg, 'w'))) {
- Kolab::log('T', "Unable to open configuration file `$cfg': $!", KOLAB_ERROR);
- exit(1);
- }
-
- while (<$cyrustemplate>) {
- if (/^KOLAB_META_START$/) {
- my $found_end;
- while (!$found_end) {
- $_ = <$cyrustemplate>;
- $found_end = /^KOLAB_META_END$/;
- }
- $_ = <$cyrustemplate>;
- }
- if (/\@{3}cyrus-imap\@{3}/ && ($Kolab::config{"cyrus-imap"} =~ /true/i)) {
- $_ = "imap cmd=\"imapd -C $imapdcfg\" listen=\"143\" prefork=0\n";
- }
- elsif (/\@{3}cyrus-imap\@{3}/ && ($Kolab::config{"cyrus-imap"} =~ /false/i)) {
- # Even if imapd is disabled, enable it for localhost -- resource handlers depend on it
- $_ = "imap cmd=\"imapd -C $imapdcfg\" listen=\"127.0.0.1:143\" prefork=0\n";
- }
- elsif (/\@{3}cyrus-pop3\@{3}/ && ($Kolab::config{"cyrus-pop3"} =~ /true/i)) {
- $_ = "pop3 cmd=\"pop3d -C $imapdcfg\" listen=\"110\" prefork=0\n";
- }
- elsif (/\@{3}cyrus-imaps\@{3}/ && ($Kolab::config{"cyrus-imaps"} =~ /true/i)) {
- $_ = "imaps cmd=\"imapd -s -C $imapdcfg\" listen=\"993\" prefork=0\n";
- }
- elsif (/\@{3}cyrus-pop3s\@{3}/ && ($Kolab::config{"cyrus-pop3s"} =~ /true/i)) {
- $_ = "pop3s cmd=\"pop3d -s -C $imapdcfg\" listen=\"995\" prefork=0\n";
- }
- elsif (/\@{3}cyrus-sieve\@{3}/ && ($Kolab::config{"cyrus-sieve"} =~ /true/i)) {
- $_ = "sieve cmd=\"timsieved -C $imapdcfg\" listen=\"2000\" prefork=0\n";
- }
- $_ =~ s/\@{3}.*\@{3}//;
- print $cyrusconf $_;
- }
-
- $cyrustemplate->close;
- $cyrusconf->close;
-
- fixup( $cfg, $ownership{$cfg}, $permissions{$cfg});
-
- if (-f $oldcfg) {
- my $rc = `diff -q $cfg $oldcfg`;
- chomp($rc);
- if ($rc) {
- Kolab::log('T', "`$cfg' change detected: $rc", KOLAB_DEBUG);
- $haschanged{'imapd'} = 1;
- }
- } else {
- $haschanged{'imapd'} = 1;
- }
-
- Kolab::log('T', 'Finished building Cyrus config', KOLAB_DEBUG);
-}
-
sub buildCyrusGroups
{
Kolab::log('T', 'Building Cyrus groups', KOLAB_DEBUG);
@@ -754,7 +671,6 @@
buildPostfixVirtualMap;
buildLDAPAccess;
buildLDAPReplicas;
- buildCyrusConfig;
buildCyrusGroups;
Kolab::log('T', 'Finished regenerating configuration files', KOLAB_DEBUG );
More information about the commits
mailing list