|
|
|
@ -266,11 +266,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { |
|
|
|
|
# Search for Zimbra users, but exclude known system accounts |
|
|
|
|
my $zim_user_search = $zim_ldap->ldap->search( |
|
|
|
|
base => 'ou=people,' . $domain_entry->{dn}, |
|
|
|
|
filter => '(&(objectClass=zimbraAccount)(!(|' . |
|
|
|
|
'(mail=' . $zim_ldap->global->get_value('zimbraSpamIsSpamAccount') . ')' . |
|
|
|
|
'(mail=' . $zim_ldap->global->get_value('zimbraSpamIsNotSpamAccount') . ')' . |
|
|
|
|
'(mail=' . $zim_ldap->global->get_value('zimbraAmavisQuarantineAccount') . ')' . |
|
|
|
|
'(uid=galsync*)(uid=admin))))', |
|
|
|
|
filter => '(&(objectClass=zimbraAccount)(!(zimbraIsSystemAccount=TRUE)))'; |
|
|
|
|
attrs => [ |
|
|
|
|
( map { $conf->{domains}->{$domain}->{users}->{attr_map}->{$_} } |
|
|
|
|
keys $conf->{domains}->{$domain}->{users}->{attr_map} ), |
|
|
|
@ -314,11 +310,6 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { |
|
|
|
|
# or which exist in both but need to be updated |
|
|
|
|
foreach my $user ( keys $ext_users ) { |
|
|
|
|
my $attrs = ''; |
|
|
|
|
# Ignore admin |
|
|
|
|
if ( $user eq 'admin' ) { |
|
|
|
|
log_verbose( "Skiping admin user"); |
|
|
|
|
next; |
|
|
|
|
} |
|
|
|
|
if ( defined $zim_users->{$user} ) { |
|
|
|
|
|
|
|
|
|
# User exists in Zimbra, lets check its attribute are up to date |
|
|
|
@ -597,7 +588,11 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { |
|
|
|
|
|
|
|
|
|
if ( not yaml_bool( $conf->{domains}->{$domain}->{groups}->{members_as_dn} ) ) { |
|
|
|
|
# If members are not listed as full DN, but by uid, simply concat it with the domain |
|
|
|
|
foreach my $member ( $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{members_attr}} ) { |
|
|
|
|
foreach my $member ( @{ $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{members_attr}} } ) { |
|
|
|
|
if ( not defined $ext_users->{$member} ) { |
|
|
|
|
log_verbose( "Skiping member $member of group $group as it doesn't match a Zimbra user" ); |
|
|
|
|
next; |
|
|
|
|
} |
|
|
|
|
next if ( not defined $ext_users->{$member} and |
|
|
|
|
not defined $ext_groups->{$member} ); |
|
|
|
|
push @ext_members, $member . '@' . $domain; |
|
|
|
|