mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 13:43:22 +00:00
See ChangeLog
Monotone-Parent: 398d5b0c3ce7ef971f2aa9111d0c4c5da3cba021 Monotone-Revision: 45563a5428bd14a897f31d8c32c9bec7cafb0e73 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-08-25T13:09:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -502,10 +502,11 @@
|
||||
|
||||
- (void) _appendSystemMailAccount
|
||||
{
|
||||
NSString *fullName, *imapLogin, *imapServer, *signature, *encryption, *port, *scheme;
|
||||
NSMutableDictionary *mailAccount, *identity, *mailboxes;
|
||||
NSMutableArray *identities;
|
||||
NSString *fullName, *imapLogin, *imapServer, *signature;
|
||||
NSArray *mails;
|
||||
NSURL *url;
|
||||
unsigned int count, max;
|
||||
|
||||
mailAccount = [NSMutableDictionary new];
|
||||
@@ -516,8 +517,46 @@
|
||||
if (!imapServer)
|
||||
imapServer = [[self domainDefaults] imapServer];
|
||||
|
||||
// imapServer might have the following format
|
||||
// localhost
|
||||
// localhost:143
|
||||
// imap://localhost
|
||||
// imap://localhost:143
|
||||
// imaps://localhost:993
|
||||
// imaps://localhost:143/?tls=YES
|
||||
// imaps://localhost/?tls=YES
|
||||
url = [NSURL URLWithString: imapServer];
|
||||
|
||||
scheme = [url scheme];
|
||||
port = [url port];
|
||||
|
||||
encryption = @"none";
|
||||
port = @"143";
|
||||
|
||||
if ([url query] && [[url query] caseInsensitiveCompare: @"tls=YES"] == NSOrderedSame)
|
||||
encryption = @"tls";
|
||||
|
||||
if ([port intValue] == 0)
|
||||
{
|
||||
if (scheme)
|
||||
{
|
||||
if ([scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame &&
|
||||
![encryption isEqualToString: @"tls"])
|
||||
{
|
||||
encryption = @"ssl";
|
||||
port = @"993";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ([url host])
|
||||
imapServer = [url host];
|
||||
|
||||
[mailAccount setObject: imapLogin forKey: @"userName"];
|
||||
[mailAccount setObject: imapServer forKey: @"serverName"];
|
||||
[mailAccount setObject: port forKey: @"port"];
|
||||
[mailAccount setObject: encryption forKey: @"encryption"];
|
||||
|
||||
|
||||
identities = [NSMutableArray new];
|
||||
mails = [self allEmails];
|
||||
|
||||
Reference in New Issue
Block a user