+2005-07-06 Helge Hess <helge.hess@opengroupware.org>
+
+ * SOGoMailManager.m: detect Cyrus 'permission denied' when changing
+ flags and deliver a http-code 403 exception (v0.9.84)
+
2005-03-25 Helge Hess <helge.hess@opengroupware.org>
* v0.9.83
SOGoNoDraftDeleteAfterSend YES|NO - makes the draft's -delete method a NOOP
SOGoSpecialFoldersInRoot YES|NO - do special folders live under INBOX?
+ - corresponds to the Cyrus setting: "altnamespace: yes"
SOGoEnableSieveFolder YES|NO - should the Sieve folder be visible?
if (um == nil)
um = [[AgenorUserManager sharedUserManager] retain];
- uid = [[self container] davDisplayName];
+ uid = [[self container] davDisplayName]; /* the uid part of the URL */
account = [um getIMAPAccountStringForUID:uid];
return account ? [NSArray arrayWithObject:account] : nil;
if (![_f isKindOfClass:[NSArray class]])
_f = [NSArray arrayWithObjects:&_f count:1];
-
+
/* get client */
if ((client = [self imap4ClientForURL:_url password:_p]) == nil)
add:[NSNumber numberWithBool:_flag]
flags:_f];
if (![[result valueForKey:@"result"] boolValue]) {
+ unsigned int status;
+ NSString *r;
+
+ r = [result valueForKey:@"reason"];
+ if ([r isEqualToString:@"Permission denied"]) {
+ /* different for each server?, no error codes in IMAP4 ... */
+ status = 403 /* Forbidden */;
+ }
+ else
+ status = 500 /* internal server error */;
+
[self logWithFormat:@"DEBUG: fail result %@", result];
- return [NSException exceptionWithHTTPStatus:500 /* server error */
- reason:@"failed to add flag to IMAP4 message"];
+
+ r = [@"Failed to add flag to IMAP4 message: " stringByAppendingString:r];
+
+ return [NSException exceptionWithHTTPStatus:status /* server error */
+ reason:r];
}
/* result contains 'fetch' key with the current flags */
return nil;