steffen: server/kolabd/kolabd Makefile.am, 1.1, 1.2 kolab_smtpdpolicy.in, 1.1, 1.2 Makefile.in, 1.1, NONE
cvs at intevation.de
cvs at intevation.de
Fri Sep 16 14:50:56 CEST 2005
Author: steffen
Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv2999/kolabd
Modified Files:
Makefile.am kolab_smtpdpolicy.in
Removed Files:
Makefile.in
Log Message:
new conf file for policy daemon plus a couple of fixed for stuff broken by the autoconfiscation process. Fixes Issue832 for kolab 2.1
Index: Makefile.am
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am 13 Sep 2005 14:38:22 -0000 1.1
+++ Makefile.am 16 Sep 2005 12:50:54 -0000 1.2
@@ -43,6 +43,7 @@
templates/ldap.conf.template \
templates/main.cf.template \
templates/master.cf.template \
+ templates/kolab_smtpdpolicy.conf.template \
templates/php.ini.template \
templates/proftpd.conf.template \
templates/rc.conf.template \
@@ -386,6 +387,12 @@
$(do_subst) <$(srcdir)/templates/master.cf.template.in >$@
CLEANFILES += templates/master.cf.template
EXTRA_DIST += templates/master.cf.template.in
+
+templates/kolab_smtpdpolicy.conf.template:
+ @$(mkinstalldirs) templates
+ $(do_subst) <$(srcdir)/templates/kolab_smtpdpolicy.conf.template.in >$@
+CLEANFILES += templates/kolab_smtpdpolicy.conf.template
+EXTRA_DIST += templates/kolab_smtpdpolicy.conf.template.in
templates/php.ini.template:
@$(mkinstalldirs) templates
Index: kolab_smtpdpolicy.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_smtpdpolicy.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- kolab_smtpdpolicy.in 13 Sep 2005 14:38:22 -0000 1.1
+++ kolab_smtpdpolicy.in 16 Sep 2005 12:50:54 -0000 1.2
@@ -26,6 +26,7 @@
use Net::LDAP::Entry;
use Net::hostent;
use Socket;
+use Kolab::Util;
#
# Usage: kolab_smtpd_policy.pl [-v]
@@ -96,12 +97,13 @@
# NOTE: comment out the $syslog_socktype line if syslogging does not
# work on your system.
#
-$syslog_socktype = 'unix'; # inet, unix, stream, console
-$syslog_facility="mail";
-$syslog_options="pid";
-$syslog_priority="info";
+my %conf;
+my $syslog_socktype = 'unix'; # inet, unix, stream, console
+my $syslog_facility="mail";
+my $syslog_options="pid";
+my $syslog_priority="info";
-$ldap_max_tries = 5;
+my $ldap_max_tries = 5;
sub mylog {
my $prio = shift;
@@ -121,13 +123,14 @@
}
sub ldap_connect {
- my $ldapuri = URI->new($conf_ldapuri) || fatal_exit("error: could not parse given uri");
- $ldap = Net::LDAP->new($conf_ldapuri) || fatal_exit("could not connect ldap server");
+ my $ldapuri = URI->new($conf_ldapuri) || fatal_exit("error: could not parse given uri $conf_ldapuri");
+ $ldap = Net::LDAP->new($conf_ldapuri) || fatal_exit("could not connect ldap server $conf_ldapuri: $@");
if ($ldap) {
if( $conf_binddn ) {
- $ldap->bind( $conf_binddn, password => $conf_bindpw ) || fatal_exit( "could not bind as $conf_binddn" );
+ $ldap->bind( $conf_binddn, password => $conf_bindpw )
+ || fatal_exit( "could not bind as $conf_binddn: $@" );
} else {
- $ldap->bind || fatal_exit("could not bind");
+ $ldap->bind || fatal_exit("could not bind: $@");
}
} else {
fatal_exit( "Could not contact LDAP server" );
@@ -302,9 +305,21 @@
openlog $0, $syslog_options, $syslog_facility;
#
-# We don't need getopt() for now.
+# Read options from config-file
#
$conf_allowunauth = 0;
+%conf = readConfig( %conf, "@sysconfdir@/kolab/kolab_smtpdpolicy.conf" );
+$conf_ldapuri = $conf{'ldap_uri'};
+$conf_basedn = $conf{'basedn'};
+$conf_bindn = $conf{'binddn'};
+$conf_bindpw = $conf{'bindpw'};
+$conf_domain = $conf{'domain'};
+$conf_allowunauth = 1 if( $conf{'allow_unauth'} );
+ at conf_permithosts = split /\s*,\s*/, $conf{'permithosts'};
+
+#
+# Allow user to override on commandline
+#
while ($option = shift(@ARGV)) {
if ($option eq "-v") {
$verbose = 1;
@@ -321,6 +336,7 @@
} elsif ($option eq '-allow-unauth') {
$conf_allowunauth = 1;
} elsif ($option eq '-permithosts') {
+ @conf_permithosts = ();
for my $h (split /\s*,\s*/, shift(@ARGV)) {
push @conf_permithosts, $h;
}
--- Makefile.in DELETED ---
More information about the commits
mailing list