From b40d5e24d1fe46b20d9e6be8a9435e1422c81be4 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 17 Oct 2016 11:40:17 -0400 Subject: [PATCH] (fix) only consider SMTP proxyAddresses for AD (fixes #3842) --- SoObjects/SOGo/LDAPSource.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index c9c2234d3..50a834ac8 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -919,9 +919,12 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses { ldapValue = [allValues objectAtIndex: i]; r = [ldapValue rangeOfString: @":"]; + if (r.length) { - [emails addObject: [ldapValue substringFromIndex: r.location+1]]; + // We only keep "smtp" ones + if ([[ldapValue lowercaseString] hasPrefix: @"smtp"]) + [emails addObject: [ldapValue substringFromIndex: r.location+1]]; } else [emails addObject: ldapValue];