|
|
@ -129,10 +129,8 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { |
|
|
|
my $domain_entry = ldap2hashref( $zim_domain_search, 'zimbraDomainName' )->{$domain}; |
|
|
|
my $domain_entry = ldap2hashref( $zim_domain_search, 'zimbraDomainName' )->{$domain}; |
|
|
|
|
|
|
|
|
|
|
|
# Check if auth is set to ad or ldap |
|
|
|
# Check if auth is set to ad or ldap |
|
|
|
if ( |
|
|
|
if ( not defined $domain_entry->{zimbraAuthMech} or |
|
|
|
not defined $domain_entry->{zimbraAuthMech} or |
|
|
|
$domain_entry->{zimbraAuthMech} !~ m/^ad|ldap$/i ) { |
|
|
|
$domain_entry->{zimbraAuthMech} !~ m/^ad|ldap$/i |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
if ( yaml_bool( $conf->{domains}->{$domain}->{zimbra}->{setup_ldap_auth} ) ) { |
|
|
|
if ( yaml_bool( $conf->{domains}->{$domain}->{zimbra}->{setup_ldap_auth} ) ) { |
|
|
|
send_zmprov_cmd( "modifyDomain $domain " . build_domain_attrs( $conf->{domains}->{$domain} ) ); |
|
|
|
send_zmprov_cmd( "modifyDomain $domain " . build_domain_attrs( $conf->{domains}->{$domain} ) ); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -186,7 +184,8 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { |
|
|
|
log_verbose( "StartTLS succeeded" ); |
|
|
|
log_verbose( "StartTLS succeeded" ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( defined $conf->{domains}->{$domain}->{ldap}->{bind_dn} and defined $conf->{domains}->{$domain}->{ldap}->{bind_pass} ) { |
|
|
|
if ( defined $conf->{domains}->{$domain}->{ldap}->{bind_dn} and |
|
|
|
|
|
|
|
defined $conf->{domains}->{$domain}->{ldap}->{bind_pass} ) { |
|
|
|
log_verbose( "Trying to bind as " . $conf->{domains}->{$domain}->{ldap}->{bind_dn} ); |
|
|
|
log_verbose( "Trying to bind as " . $conf->{domains}->{$domain}->{ldap}->{bind_dn} ); |
|
|
|
my $bind = $ext_ldap->bind( |
|
|
|
my $bind = $ext_ldap->bind( |
|
|
|
$conf->{domains}->{$domain}->{ldap}->{bind_dn}, |
|
|
|
$conf->{domains}->{$domain}->{ldap}->{bind_dn}, |
|
|
|