mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 16:33:22 +00:00
Monotone-Parent: dcceb57e8e6ee4fbdfba1d9ff1f44cb1c59b56f5
Monotone-Revision: b9fb860f8f7838df1fa7d5d3aa5503299b0ca08a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-02T04:02:46 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user