diff --git a/ChangeLog b/ChangeLog index a07de8a34..a8dc03aba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-12-15 Ludovic Marcotte + + * SoObjects/SOGo/SOGoSieveManager.m - slightly reworked + the code to use NSURL in order to instanciate the SOPE + Sieve code - that permits using TLS. + 2011-12-14 Francis Lachapelle * UI/WebServerResources/ContactsUI.js (getMenus): register the diff --git a/Documentation/SOGo Installation Guide.odt b/Documentation/SOGo Installation Guide.odt index 269c388ce..0c1afc57d 100644 Binary files a/Documentation/SOGo Installation Guide.odt and b/Documentation/SOGo Installation Guide.odt differ diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index 4f32f969e..e20c1fd8b 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -622,12 +622,13 @@ static NSString *sieveScriptName = @"sogo"; { NSMutableArray *req; NSMutableString *script, *header; - NGInternetSocketAddress *address; NSDictionary *result, *values; SOGoUserDefaults *ud; SOGoDomainDefaults *dd; NGSieveClient *client; NSString *filterScript, *v, *sieveServer; + NSURL *url; + int sievePort; BOOL b, connected; @@ -744,19 +745,20 @@ static NSString *sieveScriptName = @"sogo"; // // sieve://localhost // sieve://localhost:2000 + // sieve://localhost:2000/?tls=YES // // Values such as "localhost" or "localhost:2000" are NOT supported. // sieveServer = [dd sieveServer]; sievePort = 2000; + url = nil; if (!sieveServer) { NSString *s; - - sieveServer = @"localhost"; + s = [dd imapServer]; - + if (s) { NSURL *url; @@ -768,26 +770,20 @@ static NSString *sieveScriptName = @"sogo"; else sieveServer = s; } + else + sieveServer = @"localhost"; + + url = [NSURL URLWithString: [NSString stringWithFormat: @"%@:%d", sieveServer, sievePort]]; } else { - NSURL *url; - url = [NSURL URLWithString: sieveServer]; - - if ([url host]) - sieveServer = [url host]; - - if ([[url port] intValue] != 0) - sievePort = [[url port] intValue]; } - address = [NGInternetSocketAddress addressWithPort: sievePort onHost: sieveServer]; - - client = [NGSieveClient clientWithAddress: address]; + client = [[NGSieveClient alloc] initWithURL: url]; if (!client) { - NSLog(@"Sieve connection failed on %@", [address description]); + NSLog(@"Sieve connection failed on %@", [url description]); return NO; } @@ -808,7 +804,7 @@ static NSString *sieveScriptName = @"sogo"; if (!connected) { - NSLog(@"Sieve connection failed on %@", [address description]); + NSLog(@"Sieve connection failed on %@", [url description]); return NO; }