Defaults
========
-SOGoEnableIMAP4Debug YES|NO - enable/disable debugging in SOGoMailManager
-SOGoDisableIMAP4Pooling YES|NO - disable IMAP4 connection pooling
+SOGoEnableIMAP4Debug YES|NO - enable/disable debugging in SOGoMailManager
+SOGoDisableIMAP4Pooling YES|NO - disable IMAP4 connection pooling
+SOGoMailSpoolPath path - FS path where mail drafts are stored
+SOGoNoDraftDeleteAfterSend YES|NO - makes the draft's -delete method a NOOP
static BOOL debugOn = NO;
+ (void)initialize {
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+
+ if ((draftDeleteDisabled = [ud boolForKey:@"SOGoNoDraftDeleteAfterSend"]))
+ NSLog(@"WARNING: draft delete is disabled! (SOGoNoDraftDeleteAfterSend)");
+
TextPlainType = [[NGMimeType mimeType:@"text" subType:@"plain"] copy];
MultiMixedType = [[NGMimeType mimeType:@"multipart" subType:@"mixed"] copy];
}
return NO;
}
if (![self _ensureDraftFolderPath]) {
- [self logWithFormat:@"ERROR: could not create folder for draft!"];
+ [self logWithFormat:@"ERROR: could not create folder for draft: '%@'",
+ [self draftFolderPath]];
return NO;
}
if (![_info writeToFile:[self infoPath] atomically:YES]) {
- [self logWithFormat:@"ERROR: could not write info %@", [self infoPath]];
+ [self logWithFormat:@"ERROR: could not write info: '%@'", [self infoPath]];
return NO;
}
return YES;
if ((lInfo = [self fetchInfo]) == nil)
return nil;
- self->envelope = [[NGImap4Envelope alloc] init];
-
- self->envelope->msgId = [[self nameInContainer] copy];
- self->envelope->subject = [[lInfo objectForKey:@"subject"] copy];
-
- self->envelope->from =
- [[NGImap4EnvelopeAddress alloc] initWithString:[self sender]];
-
- if ([(tmp = [lInfo objectForKey:@"replyTo"]) length] > 0) {
- self->envelope->replyTo =
- [[NGImap4EnvelopeAddress alloc] initWithString:tmp];
- }
-
- self->envelope->to = [[self imap4EnvelopeAddressesForStrings:
- [lInfo objectForKey:@"to"]] copy];
- self->envelope->cc = [[self imap4EnvelopeAddressesForStrings:
- [lInfo objectForKey:@"cc"]] copy];
- self->envelope->bcc = [[self imap4EnvelopeAddressesForStrings:
- [lInfo objectForKey:@"bcc"]] copy];
+ self->envelope =
+ [[NGImap4Envelope alloc] initWithMessageID:[self nameInContainer]
+ subject:[lInfo objectForKey:@"subject"]
+ sender:[self sender]
+ replyTo:[lInfo objectForKey:@"replyTo"]
+ to:[lInfo objectForKey:@"to"]
+ cc:[lInfo objectForKey:@"cc"]
+ bcc:[lInfo objectForKey:@"bcc"]];
return self->envelope;
}