diff --git a/NEWS b/NEWS index 82530b7fc..122f234b6 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Bug fixes - [web] properly handle Windows-1256 charaset (#4781) - [web] fixed saving value of receipt action for main IMAP account - [web] fixed search results in Calendar module when targeting all events + - [core] honor IMAPLoginFieldName also when setting IMAP ACLs 4.0.8 (2019-07-19) ------------------ diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 53e06499b..bb723cc6c 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -60,6 +60,7 @@ #import #import #import +#import #import #import #import @@ -1423,15 +1424,19 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data) - (NSString *) _sogoACLUIDToIMAPUID: (NSString *) uid { + SOGoUser *user; + + user = [SOGoUser userWithLogin: uid]; + if ([uid hasPrefix: @"@"]) return [[[[context activeUser] domainDefaults] imapAclGroupIdPrefix] stringByAppendingString: [uid substringFromIndex: 1]]; else if ([[[context activeUser] domainDefaults] forceExternalLoginWithEmail]) - { - return [[[SOGoUser userWithLogin: uid] primaryIdentity] objectForKey: @"email"]; - } - else - return uid; + return [[user primaryIdentity] objectForKey: @"email"]; + + return [[SOGoUserManager sharedUserManager] + getExternalLoginForUID: [user loginInDomain] + inDomain: [user domain]]; } - (void) _removeIMAPExtUsernames