diff --git a/zmldapsync/zmldapsync.pl b/zmldapsync/zmldapsync.pl index 5cb93c4..7a8be89 100644 --- a/zmldapsync/zmldapsync.pl +++ b/zmldapsync/zmldapsync.pl @@ -597,7 +597,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;