Fixed the handling of TLS/SSL sockets, again.

Monotone-Parent: 09f0f8877795f3a345aa7c98083aa8c1a62ad06f
Monotone-Revision: 3041774927e7490f413c502580f789b26a0e693d

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-09-03T12:21:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2010-09-03 12:21:48 +00:00
parent 716d156847
commit 8328374042
2 changed files with 12 additions and 6 deletions
+9 -4
View File
@@ -522,12 +522,17 @@ static NSString *sieveScriptName = @"sogo";
mailAccount = [self _mailAccount];
encryption = [mailAccount objectForKey: @"encryption"];
defaultPort = 143;
protocol = @"imaps";
protocol = @"imap";
if ([encryption isEqualToString: @"ssl"])
defaultPort = 993;
else if (![encryption isEqualToString: @"tls"])
protocol = @"imap";
{
protocol = @"imaps";
defaultPort = 993;
}
else if ([encryption isEqualToString: @"tls"])
{
protocol = @"imaps";
}
username = [mailAccount objectForKey: @"userName"];
escUsername
+3 -2
View File
@@ -531,14 +531,15 @@
url = [NSURL URLWithString: imapServer];
scheme = [url scheme];
port = [url port];
port = ([url port] ? [url port] : @"143");
encryption = @"none";
if ([url query] && [[url query] caseInsensitiveCompare: @"tls=YES"] == NSOrderedSame)
encryption = @"tls";
if ([scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame &&
if (scheme &&
[scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame &&
![encryption isEqualToString: @"tls"])
{
encryption = @"ssl";