diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index f956c5bd7..08ef11d39 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -521,16 +521,13 @@ static NSString *sieveScriptName = @"sogo"; mailAccount = [self _mailAccount]; encryption = [mailAccount objectForKey: @"encryption"]; - defaultPort = [[mailAccount objectForKey: @"port"] intValue]; + defaultPort = 143; + protocol = @"imaps"; - if (!defaultPort) - defaultPort = 143; - - if ([encryption isEqualToString: @"ssl"] || - [encryption isEqualToString: @"tls"]) - protocol = @"imaps"; - else - protocol = @"imap"; + if ([encryption isEqualToString: @"ssl"]) + defaultPort = 993; + else if (![encryption isEqualToString: @"tls"]) + protocol = @"imap"; username = [mailAccount objectForKey: @"userName"]; escUsername @@ -542,8 +539,9 @@ static NSString *sieveScriptName = @"sogo"; port = [[mailAccount objectForKey: @"port"] intValue]; if (port && port != defaultPort) [imap4URLString appendFormat: @":%d", port]; + [imap4URLString appendString: @"/"]; - + return imap4URLString; } diff --git a/SoObjects/Mailer/SOGoMailBaseObject.m b/SoObjects/Mailer/SOGoMailBaseObject.m index be239344a..a0ebd65c9 100644 --- a/SoObjects/Mailer/SOGoMailBaseObject.m +++ b/SoObjects/Mailer/SOGoMailBaseObject.m @@ -198,7 +198,7 @@ static BOOL debugOn = YES; urlString = [NSString stringWithFormat: @"%@?tls=YES", [self imap4URLString]]; else - urlString = [self imap4URLString]; + urlString = [self imap4URLString]; imap4URL = [[NSURL alloc] initWithString: urlString]; } diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 1485ab28e..cc903dd05 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -534,22 +534,17 @@ port = [url port]; encryption = @"none"; - port = @"143"; if ([url query] && [[url query] caseInsensitiveCompare: @"tls=YES"] == NSOrderedSame) encryption = @"tls"; - if ([port intValue] == 0) + if ([scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame && + ![encryption isEqualToString: @"tls"]) { - if (scheme) - { - if ([scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame && - ![encryption isEqualToString: @"tls"]) - { - encryption = @"ssl"; - port = @"993"; - } - } + encryption = @"ssl"; + + if ([port intValue] == 0) + port = @"993"; } if ([url host]) diff --git a/UI/PreferencesUI/UIxPreferences.h b/UI/PreferencesUI/UIxPreferences.h index 1ef64f6c0..a724635e2 100644 --- a/UI/PreferencesUI/UIxPreferences.h +++ b/UI/PreferencesUI/UIxPreferences.h @@ -1,6 +1,6 @@ /* UIxPreferences.h - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. + * Copyright (C) 2007-2010 Inverse inc. * * Author: Wolfgang Sourdeau *