diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 945b1fd80..8a3e0442a 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -2124,7 +2124,8 @@ Multi-domains Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want your installation to isolate two groups of users, you must -define a distinct authentication source for each _domain_. Following is +define a distinct authentication source for each _domain_. Your domain keys +must have the same value as your email domain you want to add. Following is the same configuration that now includes two domains (acme.com and coyote.com): @@ -2132,7 +2133,7 @@ coyote.com): { ... domains = { - acme = { + acme.com = { SOGoMailDomain = acme.com; SOGoDraftsFolderName = Drafts; SOGoUserSources = ( @@ -2153,7 +2154,7 @@ coyote.com): } ); }; - coyote = { + coyote.com = { SOGoMailDomain = coyote.com; SOGoIMAPServer = imap.coyote.com; SOGoUserSources = ( @@ -2184,7 +2185,7 @@ domains. [cols="3,47,50a"] |======================================================================= |S |SOGoEnableDomainBasedUID -|Parameter used to activate user identification by domain. Users will be +|Parameter used to enable user identification by domain. Users will be able (without being required) to login using the form `username@domain`, meaning that values of _UIDFieldName_ no longer have to be unique among all domains but only within the same domain. Internally, users will @@ -2706,6 +2707,9 @@ h|2.3.0 This will grow the "participant states" field of calendar quick tables to a larger size and add the the "c_description" column to calendar quick tables. +Moreover, if you are using a multi-domain configuration, make sure the keys for +your domains match the email domains you have defined. + h|2.2.8 |The configuration configuration parameters were renamed: diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 12d028fd3..fa6459f59 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -165,8 +165,9 @@ // The domain is probably appended to the username; // make sure it is defined as a domain in the configuration. domain = [newLogin substringFromIndex: (r.location + r.length)]; - if (![[sd domainIds] containsObject: domain]) - domain = nil; + if ([[sd domainIds] containsObject: domain] && + ![sd enableDomainBasedUID]) + newLogin = [newLogin substringToIndex: r.location]; if (domain != nil && ![sd enableDomainBasedUID]) // Login domains are enabled (SOGoLoginDomains) but not diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 6ee3b4d76..21cebce2d 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -514,21 +514,9 @@ static Class NSNullK; if (r.location != NSNotFound) { - NSArray *allDomains; - int i; - *_domain = [username substringFromIndex: r.location+1]; - allDomains = [[dd dictionaryForKey: @"domains"] allValues]; - - for (i = 0; i < [allDomains count]; i++) - { - if ([*_domain isEqualToString: [[allDomains objectAtIndex: i] objectForKey: @"SOGoMailDomain"]]) - break; - } - - // We haven't found one - if (i == [allDomains count]) + if (![[[SOGoSystemDefaults sharedSystemDefaults] domainIds] containsObject: *_domain]) *_domain = nil; } }