Proper fix for #2163.

This commit is contained in:
Ludovic Marcotte
2013-01-11 09:55:10 -05:00
parent 0e0b7728fd
commit 9d4f4c3a9c
7 changed files with 27 additions and 15 deletions
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
/* SOGoDomainDefaults.h - this file is part of SOGo
*
* Copyright (C) 2009-2012 Inverse inc.
* Copyright (C) 2009-2013 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
@@ -47,7 +47,7 @@
- (NSString *) imapAclGroupIdPrefix;
- (NSString *) imapFolderSeparator;
- (BOOL) imapAclConformsToIMAPExt;
- (BOOL) forceIMAPLoginWithEmail;
- (BOOL) forceExternalLoginWithEmail;
- (BOOL) sieveScriptsEnabled;
- (BOOL) forwardEnabled;
- (BOOL) vacationEnabled;
+8 -1
View File
@@ -171,8 +171,15 @@
return [self stringArrayForKey: @"SOGoContactsDefaultRoles"];
}
- (BOOL) forceIMAPLoginWithEmail
//
// In v2.0.4, SOGoForceIMAPLoginWithEmail was renamed to SOGoForceExternalLoginWithEmail
// but we keep backward compatbility for now with previous versions.
//
- (BOOL) forceExternalLoginWithEmail
{
if ([self stringForKey: @"SOGoForceExternalLoginWithEmail"])
return [self boolForKey: @"SOGoForceExternalLoginWithEmail"];
return [self boolForKey: @"SOGoForceIMAPLoginWithEmail"];
}
+9 -4
View File
@@ -1,6 +1,6 @@
/* SOGoMailer.m - this file is part of SOGo
*
* Copyright (C) 2007-2010 Inverse inc.
* Copyright (C) 2007-2013 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
@@ -37,6 +37,7 @@
#import "SOGoDomainDefaults.h"
#import "SOGoSystemDefaults.h"
#import "SOGoUser.h"
#import "SOGoUserManager.h"
#import "SOGoMailer.h"
@@ -121,17 +122,18 @@
withAuthenticator: (id <SOGoAuthenticator>) authenticator
inContext: (WOContext *) woContext
{
NGInternetSocketAddress *addr;
NSString *currentTo, *host, *login, *password;
NGInternetSocketAddress *addr;
NSMutableArray *toErrors;
NSEnumerator *addresses;
NGSmtpClient *client;
NSException *result = nil;
NSException *result;
NSRange r;
unsigned int port;
client = [NGSmtpClient smtpClient];
host = smtpServer;
result = nil;
port = 25;
// We check if there is a port specified in the smtpServer ivar value
@@ -151,7 +153,10 @@
[client connectToAddress: addr];
if ([authenticationType isEqualToString: @"plain"])
{
login = [[authenticator userInContext: woContext] login];
login = [[SOGoUserManager sharedUserManager]
getExternalLoginForUID: [[authenticator userInContext: woContext] loginInDomain]
inDomain: [[authenticator userInContext: woContext] domain]];
password = [authenticator passwordInContext: woContext];
if ([login length] == 0
|| [login isEqualToString: @"anonymous"]
+2 -2
View File
@@ -592,8 +592,8 @@
// 1. login
imapLogin = [[SOGoUserManager sharedUserManager]
getImapLoginForUID: [self loginInDomain]
inDomain: [self domain]];
getExternalLoginForUID: [self loginInDomain]
inDomain: [self domain]];
[mailAccount setObject: imapLogin forKey: @"userName"];
// 2. server
+3 -3
View File
@@ -1,6 +1,6 @@
/* SOGoUserManager.h - this file is part of SOGo
*
* Copyright (C) 2007-2011 Inverse inc.
* Copyright (C) 2007-2013 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Francis Lachapelle <flachapelle@inverse.ca>
@@ -76,8 +76,8 @@
- (NSString *) getCNForUID: (NSString *) uid;
- (NSString *) getEmailForUID: (NSString *) uid;
- (NSString *) getFullEmailForUID: (NSString *) uid;
- (NSString *) getImapLoginForUID: (NSString *) uid
inDomain: (NSString *) domain;
- (NSString *) getExternalLoginForUID: (NSString *) uid
inDomain: (NSString *) domain;
- (NSString *) getUIDForEmail: (NSString *) email;
- (NSString *) getLoginForDN: (NSString *) theDN;
+3 -3
View File
@@ -358,8 +358,8 @@ static Class NSNullK;
return fullEmail;
}
- (NSString *) getImapLoginForUID: (NSString *) uid
inDomain: (NSString *) domain
- (NSString *) getExternalLoginForUID: (NSString *) uid
inDomain: (NSString *) domain
{
NSDictionary *contactInfos;
NSString *login;
@@ -375,7 +375,7 @@ static Class NSNullK;
else
dd = [SOGoSystemDefaults sharedSystemDefaults];
login = [dd forceIMAPLoginWithEmail] ? [self getEmailForUID: uid] : uid;
login = [dd forceExternalLoginWithEmail] ? [self getEmailForUID: uid] : uid;
}
return login;