mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-28 00:09:29 +00:00
fix(core): properly validate domain using "domains" keys
Instead of checking if the domain match a source ID, we now check if the domain match a key of the "domains" configuration parameter.
This commit is contained in:
@@ -293,10 +293,8 @@ static Class NSNullK;
|
||||
|
||||
if (!domain) return NO;
|
||||
|
||||
ids = [_sources allKeys];
|
||||
ids = [[SOGoSystemDefaults sharedSystemDefaults] domainIds];
|
||||
if ([ids containsObject: domain])
|
||||
// FIXME check SOGoMailDomain?
|
||||
// Now source id is being considered as the domain
|
||||
return YES;
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
@@ -547,7 +545,7 @@ static Class NSNullK;
|
||||
|
||||
username = _login;
|
||||
|
||||
if (*_domain)
|
||||
if (*_domain && ![*_domain isKindOfClass: NSNullK])
|
||||
{
|
||||
if ([_login rangeOfString: @"@"].location == NSNotFound)
|
||||
username = [NSString stringWithFormat: @"%@@%@", _login, *_domain];
|
||||
@@ -560,6 +558,7 @@ static Class NSNullK;
|
||||
// sources if SOGoLoginDomains isn't specified. This is also true if the user is
|
||||
// using DAV or EAS.
|
||||
r = [username rangeOfString: @"@"];
|
||||
*_domain = nil;
|
||||
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user