steffen: server/kolab/kolab kolab_bootstrap, 1.33, 1.34 kolab_smtpdpolicy, 1.4, 1.5
cvs at intevation.de
cvs at intevation.de
Thu Jun 17 04:49:16 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab/kolab
In directory doto:/tmp/cvs-serv18968/kolab/kolab
Modified Files:
kolab_bootstrap kolab_smtpdpolicy
Log Message:
smptd policy server honors "delegate" property, master/slave comm. is completely "SSL-ified" now
Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_bootstrap,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- kolab_bootstrap 14 Jun 2004 01:22:57 -0000 1.33
+++ kolab_bootstrap 17 Jun 2004 02:49:14 -0000 1.34
@@ -250,7 +250,7 @@
}
my $ldapuri = URI->new($ldap_uri) || warn "error: could not parse given uri";
- my $ldap = Net::LDAP->new($ldapuri->host, port=> $ldapuri->port) || warn "could not connect ldap server";
+ my $ldap = Net::LDAP->new($ldap_uri, verify => 'none' ) || warn "could not connect ldap server";
if ($ldap) {
$ldap->bind($bind_dn, password=> $bind_pw) || warn "could not bind to ldap";
my $mesg = $ldap->search(base=> "$base_dn", scope=> 'exact', filter=> "(objectclass=*)");
@@ -396,7 +396,7 @@
close(FH);
$cfg =~ s/\n((openldap_url|sasl_authmech)\S*=[^\n]*)/#$1\n/sg;
- $cfg .= "openldap_url=\"\"\nsasl_authmech=\"ldap\"\n";
+ $cfg .= "openldap_url=\"ldap:// ldaps://\"\nsasl_authmech=\"ldap\"\n";
open(FH, ">$kolab_prefix/etc/rc.conf") || die;
print FH $cfg;
@@ -447,7 +447,7 @@
print "Checking server info...\n";
my $ldapuri = URI->new($ldap_uri) || warn "error: could not parse given uri";
- my $ldap = Net::LDAP->new($ldapuri->host, port=> $ldapuri->port) || warn "could not connect ldap server";
+ my $ldap = Net::LDAP->new($ldap_uri, verify => 'none' ) || warn "could not connect ldap server";
if ($ldap) {
$ldap->bind($bind_dn, password=> $bind_pw) || warn "could not bind to ldap";
my $mesg = $ldap->search(base=> "$base_dn", scope=> 'exact', filter=> "(objectclass=*)");
Index: kolab_smtpdpolicy
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_smtpdpolicy,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kolab_smtpdpolicy 16 Jun 2004 01:06:29 -0000 1.4
+++ kolab_smtpdpolicy 17 Jun 2004 02:49:14 -0000 1.5
@@ -111,6 +111,13 @@
syslog $prio, $text;
}
+sub contains {
+ my $needle = shift;
+ my @haystack = shift;
+ map { return 1 if $needle eq $_ } @haystack;
+ return 0;
+}
+
#
# SMTPD access policy routine. The result is an action just like
# it would be specified on the right-hand side of a Postfix access
@@ -153,8 +160,9 @@
mylog($syslog_priority, "LDAP search returned ".$mesg->count()." objects") if $verbose;
foreach $ldapobject ($mesg->entries) {
mylog($syslog_priority, "Got object ".$ldapobject->get_value('uid') ) if $verbose;
- if( $username eq $ldapobject->get_value('uid') ) {
- # All OK, user is sending as herself
+ if( $username eq $ldapobject->get_value('uid') ||
+ contains( $username, @{$ldapobject->get_value('delegate', asref => 1 )}) ) {
+ # All OK, user is sending as herself or as delegate
mylog($syslog_priority, "$username using valid from address $sender") if $verbose;
return "DUNNO";
}
More information about the commits
mailing list