thomas: server/perl-kolab/Kolab-Conf Conf.pm.in,1.11,1.11.2.1
cvs at kolab.org
cvs at kolab.org
Wed Sep 19 19:05:51 CEST 2007
Author: thomas
Update of /kolabrepository/server/perl-kolab/Kolab-Conf
In directory doto:/tmp/cvs-serv6759/perl-kolab/Kolab-Conf
Modified Files:
Tag: kolab_2_1_branch
Conf.pm.in
Log Message:
Make cyrus configs use local_addr setting
Index: Conf.pm.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab-Conf/Attic/Conf.pm.in,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- Conf.pm.in 4 Jun 2007 06:41:10 -0000 1.11
+++ Conf.pm.in 19 Sep 2007 17:05:49 -0000 1.11.2.1
@@ -44,7 +44,6 @@
our %EXPORT_TAGS = (
'all' => [ qw(
&buildPostfixTransportMap
- &buildCyrusConfig
&buildCyrusGroups
&buildLDAPReplicas
&rebuildTemplates
@@ -68,7 +67,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);
@@ -437,85 +435,6 @@
Kolab::log('T', 'Finished building Postfix $map map', KOLAB_DEBUG);
}
-sub buildCyrusConfig
-{
- Kolab::log('T', 'Building Cyrus config', KOLAB_DEBUG);
-
- 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 `$cfg'", 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);
- $Kolab::haschanged{'imapd'} = 1;
- }
- } else {
- $Kolab::haschanged{'imapd'} = 1;
- }
-
- Kolab::log('T', 'Finished building Cyrus config', KOLAB_DEBUG);
-}
-
sub buildCyrusGroups
{
Kolab::log('T', 'Building Cyrus groups', KOLAB_DEBUG);
@@ -820,7 +739,6 @@
buildPostfixVirtualMap;
buildLDAPAccess;
buildLDAPReplicas;
- buildCyrusConfig;
buildCyrusGroups;
Kolab::log('T', 'Finished regenerating configuration files', KOLAB_DEBUG );
More information about the commits
mailing list