diff --git a/ChangeLog b/ChangeLog index d4d0e52c2..099cc3e04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,24 @@ -2009-12-23 Wolfgang Sourdeau +2009-12-26 Ludovic Marcotte - * SoObjects/Mailer/SOGoMailAccount.m (-isSharedAccount): removed - useless method. - (-sharedAccountName): removed useless method. + * SoObjects/SOGo/SOGoMailer.m (_smtpSendData: + toRecipients:sender:): We now honor the 'port' + part in the SMTP server address. So one can now + specify hostname:port (like localhost:587) as + a value of SOGoSMTPServer. This fixes + http://www.scalableogo.org/bugs/view.php?id=201 + + * SoObjects/Mailer/SOGoMailForward.m (init): + Now consider SOGoMailComposeMessageType instead + of ComposeMessagesType when checking if we are + using HTML mails composition mode. This fixes + http://www.scalableogo.org/bugs/view.php?id=280 + +2009-12-25 Ludovic Marcotte + + * Tools/SOGoToolBackup.m (-fetchUserIDs:): + We now use a local autorelease pool and flush + it after every 100 requests to the LDAP (or + other source type) server. 2009-12-23 Ludovic Marcotte diff --git a/SoObjects/Mailer/SOGoMailForward.m b/SoObjects/Mailer/SOGoMailForward.m index f2a127f12..52159376e 100644 --- a/SoObjects/Mailer/SOGoMailForward.m +++ b/SoObjects/Mailer/SOGoMailForward.m @@ -38,7 +38,12 @@ { SOGoUserDefaults *ud; ud = [[context activeUser] userDefaults]; - htmlComposition = [[ud objectForKey: @"ComposeMessagesType"] isEqualToString: @"html"]; + + // Backward comptability with <= 1.1.0 (ComposeMessagesType) + if ([ud objectForKey: @"ComposeMessagesType"]) + htmlComposition = [[ud objectForKey: @"ComposeMessagesType"] isEqualToString: @"html"]; + else + htmlComposition = [[ud objectForKey: @"SOGoMailComposeMessageType"] isEqualToString: @"html"]; sourceMail = nil; currentValue = nil; diff --git a/SoObjects/SOGo/SOGoMailer.m b/SoObjects/SOGo/SOGoMailer.m index d9d40d2b9..13cd16398 100644 --- a/SoObjects/SOGo/SOGoMailer.m +++ b/SoObjects/SOGo/SOGoMailer.m @@ -30,6 +30,7 @@ #import #import #import +#import #import "NSString+Utilities.h" #import "SOGoDomainDefaults.h" @@ -115,14 +116,32 @@ toRecipients: (NSArray *) recipients sender: (NSString *) sender { + NGInternetSocketAddress *addr; + NSString *currentTo, *host; + NSEnumerator *addresses; NGSmtpClient *client; - NSEnumerator *addresses; - NSString *currentTo; - unsigned int toErrors; NSException *result; + NSRange r; + + unsigned int toErrors, port; client = [NGSmtpClient smtpClient]; - if ([client connectToHost: smtpServer]) + host = smtpServer; + port = 25; + + // We check if there is a port specified in the smtpServer ivar value + r = [smtpServer rangeOfString: @":"]; + + if (r.length) + { + port = [[smtpServer substringFromIndex: r.location+1] intValue]; + host = [smtpServer substringToIndex: r.location]; + } + + addr = [NGInternetSocketAddress addressWithPort: port + onHost: host]; + + if ([client connectToAddress: addr]) { if ([client mailFrom: sender]) { diff --git a/Tools/SOGoToolBackup.m b/Tools/SOGoToolBackup.m index c58e7dffd..907951d56 100644 --- a/Tools/SOGoToolBackup.m +++ b/Tools/SOGoToolBackup.m @@ -21,6 +21,7 @@ */ #import +#import #import #import #import @@ -118,6 +119,7 @@ - (BOOL) fetchUserIDs: (NSArray *) users { + NSAutoreleasePool *pool; SOGoUserManager *lm; NSDictionary *infos; NSString *user; @@ -125,6 +127,8 @@ int count, max; lm = [SOGoUserManager sharedUserManager]; + pool = [[NSAutoreleasePool alloc] init]; + max = [users count]; user = [users objectAtIndex: 0]; if (max == 1 && [user isEqualToString: @"ALL"]) @@ -134,6 +138,12 @@ allUsers = [NSMutableArray array]; for (count = 0; count < max; count++) { + if (count > 0 && count%100 == 0) + { + DESTROY(pool); + pool = [[NSAutoreleasePool alloc] init]; + } + user = [users objectAtIndex: count]; infos = [lm contactInfosForUserWithUIDorEmail: user]; if (infos) @@ -144,6 +154,7 @@ } ASSIGN (userIDs, [allUsers objectsForKey: @"c_uid" notFoundMarker: nil]); + DESTROY(pool); return ([userIDs count] > 0); }