steffen: server/kolab/kolab kolab_bootstrap, 1.34, 1.35 kolab_smtpdpolicy, 1.5, 1.6 kolabconf, 1.2, 1.3 kolabd, 1.4, 1.5
cvs at intevation.de
cvs at intevation.de
Fri Jun 18 03:26:01 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab/kolab
In directory doto:/tmp/cvs-serv5335/kolab/kolab
Modified Files:
kolab_bootstrap kolab_smtpdpolicy kolabconf kolabd
Log Message:
bugfixes
Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_bootstrap,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- kolab_bootstrap 17 Jun 2004 02:49:14 -0000 1.34
+++ kolab_bootstrap 18 Jun 2004 01:25:58 -0000 1.35
@@ -445,6 +445,9 @@
$bind_pw = ReadLine;
chomp $bind_pw;
+ my $confname = "$kolab_prefix/etc/sasl/apps/smtpd.conf";
+ copy("$kolab_prefix/etc/kolab/templates/smtpd.conf.template", $confname) || die "could not write to $confname";
+
print "Checking server info...\n";
my $ldapuri = URI->new($ldap_uri) || warn "error: could not parse given uri";
my $ldap = Net::LDAP->new($ldap_uri, verify => 'none' ) || warn "could not connect ldap server";
Index: kolab_smtpdpolicy
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_smtpdpolicy,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- kolab_smtpdpolicy 17 Jun 2004 02:49:14 -0000 1.5
+++ kolab_smtpdpolicy 18 Jun 2004 01:25:58 -0000 1.6
@@ -154,7 +154,7 @@
my $reg = '.*@('.join('|', at conf_domain).')';
if( $sender =~ /$reg/ ) {
- my $mesg = $ldap->search( base=> $conf_ldapbase,
+ my $mesg = $ldap->search( base=> $conf_basedn,
scope=> 'sub', filter=> "(&(mail=$sender)(objectclass=kInetOrgPerson))");
if( !$mesg->code ) {
mylog($syslog_priority, "LDAP search returned ".$mesg->count()." objects") if $verbose;
@@ -183,8 +183,8 @@
$recip =~ /(.*)@(.*)/;
my $cn = $1;
my $domain = $2;
- if( $domain eq $Kolab::config{'postfix-mydomain'} ) {
- $mesg = $ldap->search( base=> 'cn=internal,'.$Kolab::config{'base_dn'},
+ if( contains($domain, at conf_domain ) ) {
+ $mesg = $ldap->search( base=> 'cn=internal,'.$conf_basedn,
scope=> 'one', filter=> "(&(cn=$recip)(objectclass=groupOfNames)");
if( !$mesg->code && $mesg->count() > 0 ) {
# Ups, recipient is a restricted list, reject
@@ -242,8 +242,12 @@
$verbose = 1;
} elsif ($option eq '-ldap') {
$conf_ldapuri = shift(@ARGV);
- } elsif ($option eq '-base') {
- $conf_ldapbase = shift(@ARGV);
+ } elsif ($option eq '-basedn') {
+ $conf_basedn = shift(@ARGV);
+ } elsif ($option eq '-binddn' ) {
+ $conf_binddn = shift(@ARGV);
+ } elsif ($option eq '-bindpw' ) {
+ $conf_bindpw = shift(@ARGV);
} elsif ($option eq '-domain') {
push @conf_domain, shift(@ARGV);
} elsif ($option eq '-permithosts') {
@@ -251,7 +255,7 @@
push @conf_permithosts, $h;
}
} else {
- mylog( $syslog_priority, "Invalid option: %s. Usage: %s [-v] -ldap <uri> -base <base_dn>",
+ mylog( $syslog_priority, "Invalid option: %s. Usage: %s [-v] -ldap <uri> -basedn <base_dn> [-binddn <bind_dn> -bindpw <bind_pw>] [-domain <domain>] [-permithosts <host,host,...>]",
$option, $0);
exit 1;
}
@@ -262,15 +266,23 @@
#
select((select(STDOUT), $| = 1)[0]);
+if( $verbose ) {
+ mylog( $syslog_priority, "ldap=$conf_ldapuri, basedn=$conf_basedn, binddn=$conf_binddn");
+}
+
#
# Receive a bunch of attributes, evaluate the policy, send the result.
#
my $ldapuri = URI->new($conf_ldapuri) || fatal_exit("error: could not parse given uri");
-$ldap = Net::LDAP->new($ldapuri->host, port=> $ldapuri->port) || fatal_exit("could not connect ldap server");
+$ldap = Net::LDAP->new($conf_ldapuri) || fatal_exit("could not connect ldap server");
if ($ldap) {
# $ldap->bind($Kolab::config{'bind_dn'}, password=> $Kolab::config{'bind_pw'})
# || warn "could not bind to ldap";
- $ldap->bind || fatal_exit("could not bind");
+ if( $conf_binddn ) {
+ $ldap->bind( $conf_binddn, $conf_bindpw ) || fatal_exit( "could not bind as $conf_binddn" );
+ } else {
+ $ldap->bind || fatal_exit("could not bind");
+ }
} else {
fatal_exit( "Could not contact LDAP server" );
}
Index: kolabconf
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolabconf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- kolabconf 25 May 2004 03:22:53 -0000 1.2
+++ kolabconf 18 Jun 2004 01:25:58 -0000 1.3
@@ -34,17 +34,21 @@
use Kolab::Util;
use Kolab::Conf;
use Kolab::LDAP;
-use vars qw($opt_d);
+use vars qw($opt_d $opt_l);
openlog('kolabconf', 'cons, pid', 'user');
-getopts('d');
+getopts('dl');
if ($opt_d) {
foreach my $key (sort keys %Kolab::config) {
print "$key : " . $Kolab::config{$key} . "\n";
}
exit 0;
}
+if ($opt_l) {
+ $SIG{__DIE__} = sub { Kolab::log( 'K', $_[0], KOLAB_ERROR ); }
+}
+
print 'kolabconf - Kolab Configuration Generator
Index: kolabd
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolabd,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kolabd 26 May 2004 02:10:34 -0000 1.4
+++ kolabd 18 Jun 2004 01:25:58 -0000 1.5
@@ -91,6 +91,10 @@
&run;
}
+sub sigDie {
+ Kolab::log( 'K', $_[0], KOLAB_ERROR );
+}
+
sub run
{
my $pid;
@@ -118,6 +122,7 @@
$SIG{'INT'} = \&sigInt;
$SIG{'TERM'} = \&sigInt;
$SIG{'HUP'} = \&sigHup;
+ $SIG{__DIE__} = \&sigDie;
Kolab::log('K', 'Listeners spawned, wait()ing');
More information about the commits
mailing list