mailMessage.setState(ERCMailState.SENT_STATE);
mailMessage.setDateSent(new NSTimestamp());
if (shouldDeleteSentMail()) {
if (mailMessage.shouldArchiveSentMailAsBoolean()) {
mailMessage.archive();
}
// FIXME: Nasty stack overflow bug
if (!mailMessage.hasAttachments()) {
mailMessage.editingContext().deleteObject(mailMessage);
}