Fix handling main mail attr as a Zimbra alias

master
Daniel Berteaud 5 years ago
parent bf6dc08be3
commit 84b4dc745e
  1. 10
      zmldapsync/zmldapsync.pl

@ -375,8 +375,9 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
foreach my $mail_attr ( qw( mail_attr alias_attr ) ) { foreach my $mail_attr ( qw( mail_attr alias_attr ) ) {
next if ( not defined $conf->{domains}->{$domain}->{users}->{$mail_attr} or next if ( not defined $conf->{domains}->{$domain}->{users}->{$mail_attr} or
not defined $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} ); not defined $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} );
push @ext_aliases, push @ext_aliases, ref $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} eq 'ARRAY' ?
@{ $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} }; @{ $ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}} } :
$ext_users->{$user}->{$conf->{domains}->{$domain}->{users}->{$mail_attr}};
} }
@ext_aliases = uniq( sort @ext_aliases ); @ext_aliases = uniq( sort @ext_aliases );
@ -622,8 +623,9 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
foreach my $mail_attr ( qw( mail_attr alias_attr ) ) { foreach my $mail_attr ( qw( mail_attr alias_attr ) ) {
next if ( not defined $conf->{domains}->{$domain}->{groups}->{$mail_attr} or next if ( not defined $conf->{domains}->{$domain}->{groups}->{$mail_attr} or
not defined $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} ); not defined $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} );
push @ext_aliases, push @ext_aliases, ref $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} eq 'ARRAY' ?
@{ $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} }; @{ $ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}} } :
$ext_groups->{$group}->{$conf->{domains}->{$domain}->{groups}->{$mail_attr}};
} }
@ext_aliases = uniq( sort @ext_aliases ); @ext_aliases = uniq( sort @ext_aliases );
foreach my $alias ( @ext_aliases ) { foreach my $alias ( @ext_aliases ) {

Loading…
Cancel
Save