From 63b75db468c3d0e6eb659296f54c9e3b24adc89b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 17 Jul 2019 09:31:53 +0200 Subject: [PATCH] Set zimbraAuthLdapExternalDn during user creation --- zmldapsync/zmldapsync.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zmldapsync/zmldapsync.pl b/zmldapsync/zmldapsync.pl index 15e5f6d..8a0d1e8 100644 --- a/zmldapsync/zmldapsync.pl +++ b/zmldapsync/zmldapsync.pl @@ -319,7 +319,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { foreach my $attr ( keys $conf->{domains}->{$domain}->{users}->{attr_map} ) { if ( not defined $ext_users->{$user}->{$attr} and - not defined $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} ) { + not defined $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} ) { # Attr does not exist in external LDAP and in Zimbra, no need to continue comparing them next; } @@ -368,6 +368,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { $attrs .= ' ' . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " . zim_attr_value( $ext_users->{$user}->{$attr} ); } + $attrs .= " zimbraAuthLdapExternalDn " . zim_attr_value( $ext_users->{$user}->{dn} ); # The password won't be used because Zimbra is set to use external LDAP/AD auth # But better to set it to a random value my $pass = $uuid->create_str;