diff --git a/ChangeLog b/ChangeLog index f1c620953..499655418 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-11-02 Ludovic Marcotte + + * Implemented http://sogo.nu/bugs/view.php?id=821 + 2010-11-02 Wolfgang Sourdeau * SoObjects/SOGo/NSDictionary+BSJSONAdditions.[hm]: diff --git a/Documentation/SOGo Installation Guide.odt b/Documentation/SOGo Installation Guide.odt index 41436dc79..f1abb478b 100644 Binary files a/Documentation/SOGo Installation Guide.odt and b/Documentation/SOGo Installation Guide.odt differ diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index 42d432fed..e2d8e45ff 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -236,8 +236,9 @@ static NSString *sieveScriptName = @"sogo"; SOGoUserDefaults *ud; SOGoDomainDefaults *dd; NGSieveClient *client; - NSString *filterScript, *v, *password; + NSString *filterScript, *v, *password, *sieveServer; SOGoSieveConverter *converter; + int sievePort; BOOL b; dd = [[context activeUser] domainDefaults]; @@ -338,9 +339,36 @@ static NSString *sieveScriptName = @"sogo"; [script insertString: header atIndex: 0]; } - // We connect to our Sieve server and upload the script - address = [NGInternetSocketAddress addressWithPort: 2000 - onHost: [[self imap4URL] host]]; + // We connect to our Sieve server and upload the script. + // + // sieveServer might have the following format: + // + // sieve://localhost + // sieve://localhost:2000 + // + // Values such as "localhost" or "localhost:2000" are NOT supported. + // + sieveServer = [dd sieveServer]; + sievePort = 2000; + + if (!sieveServer) + { + sieveServer = @"localhost"; + } + 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]; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index 73b7bb13a..48b87dac8 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -41,6 +41,7 @@ - (NSString *) mailDomain; - (NSString *) imapServer; +- (NSString *) sieveServer; - (NSString *) imapAclStyle; - (NSString *) imapFolderSeparator; - (BOOL) imapAclConformsToIMAPExt; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index d445348c7..1b9dc4fe0 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -113,6 +113,11 @@ return [self stringForKey: @"SOGoIMAPServer"]; } +- (NSString *) sieveServer +{ + return [self stringForKey: @"SOGoSieveServer"]; +} + #warning should be removed when we make use of imap namespace - (NSString *) imapAclStyle { diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 7fde4ba8b..3581bbcad 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -1,6 +1,6 @@ /* UIxMailPartHTMLViewer.m - this file is part of SOGo * - * Copyright (C) 2007-2009 Inverse inc. + * Copyright (C) 2007-2010 Inverse inc. * * Author: Wolfgang Sourdeau *