diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 3fff2bb5a..c46331d78 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -1,15 +1,15 @@ /* - Copyright (C) 2006-2011 Inverse inc. + Copyright (C) 2006-2013 Inverse inc. Copyright (C) 2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo. - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -622,19 +622,29 @@ // 3. port & encryption scheme = [cUrl scheme] ? [cUrl scheme] : [url scheme]; + query = [cUrl query] ? [cUrl query] : [url query]; + if (scheme && [scheme caseInsensitiveCompare: @"imaps"] == NSOrderedSame) { - encryption = @"ssl"; - defaultPort = 993; + if (query && [query caseInsensitiveCompare: @"tls=YES"] == NSOrderedSame) + { + defaultPort = 143; + encryption = @"tls"; + } + else + { + encryption = @"ssl"; + defaultPort = 993; + } } else { - query = [cUrl query] ? [cUrl query] : [url query]; if (query && [query caseInsensitiveCompare: @"tls=YES"] == NSOrderedSame) encryption = @"tls"; else encryption = @"none"; + defaultPort = 143; } port = [cUrl port] ? [cUrl port] : [url port];