diff --git a/ChangeLog b/ChangeLog index 8a101a8ae..7258ed874 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-02 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailManager.m ([NGImap + -copyMailURL:toFolderURL:password:]): do not compare the urls + based on the instance that NGImap4ConnectionManager returns, + because disabling the pooling will generate a bad result, even + though the host:port pairs are the same. + 2008-09-01 Wolfgang Sourdeau * UI/MailerUI/UIxMailView.m ([UIxMailView diff --git a/SoObjects/Mailer/SOGoMailManager.m b/SoObjects/Mailer/SOGoMailManager.m index 59c1f4c0b..b9b42e23f 100644 --- a/SoObjects/Mailer/SOGoMailManager.m +++ b/SoObjects/Mailer/SOGoMailManager.m @@ -20,6 +20,8 @@ */ #import +#import +#import #import #import @@ -194,20 +196,25 @@ password:(NSString *)_pwd { NGImap4Connection *entry; - + NSNumber *destPort, *srcPort; + /* check connection cache */ if ((entry = [self connectionForURL:_srcurl password:_pwd]) == nil) return [self errorForMissingEntryAtURL:_srcurl]; /* check whether URLs are on different servers */ - - if ([self connectionForURL:_desturl password:_pwd] != entry) { + srcPort = [_srcurl port]; + destPort = [_desturl port]; + + if (!([[_desturl host] isEqualToString: [_srcurl host]] + && (srcPort == destPort + || [destPort isEqualToNumber: srcPort]))) { // TODO: find a better error code return [NSException exceptionWithHTTPStatus:502 /* Bad Gateway */ reason:@"source and destination on different servers"]; - } - + } + return [entry copyMailURL:_srcurl toFolderURL:_desturl]; }