mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-05 10:29:43 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user