Fix dedup aliases

master
Daniel Berteaud 5 years ago
parent f6f14a81c5
commit 2f52692a8b
  1. 4
      zmldapsync/zmldapsync.pl

@ -389,7 +389,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
@{ $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} }; @{ $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} };
} }
@ext_aliases = sort uniq @ext_aliases; @ext_aliases = uniq( sort @ext_aliases );
foreach my $alias ( @ext_aliases ) { foreach my $alias ( @ext_aliases ) {
next if ( not alias_matches_domain( $alias, $domain_entry ) ); next if ( not alias_matches_domain( $alias, $domain_entry ) );
@ -631,7 +631,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
push @ext_aliases, push @ext_aliases,
@{ $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} }; @{ $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} };
} }
@ext_aliases = sort uniq @ext_aliases; @ext_aliases = uniq( sort @ext_aliases );
foreach my $alias ( @ext_aliases ) { foreach my $alias ( @ext_aliases ) {
next if ( not alias_matches_domain( $alias, $domain_entry ) ); next if ( not alias_matches_domain( $alias, $domain_entry ) );
next if ( grep { $alias eq $_ } @{ $zim_dl->{$group}->{mail} } ); next if ( grep { $alias eq $_ } @{ $zim_dl->{$group}->{mail} } );

Loading…
Cancel
Save