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:
Ludovic Marcotte
2010-08-25 13:09:25 +00:00
parent ccd69d3f88
commit d79565bc90
6 changed files with 56 additions and 11 deletions
+40 -1
View File
@@ -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];