summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-10-11 21:11:42 +0000
committerthomascube <thomas@roundcube.net>2005-10-11 21:11:42 +0000
commit520c36aa4c24ad3424b8fa3137b7576e6eacaf14 (patch)
treec14b4f621fb213f9fe71a8230ef8ac1f68a21aa0 /program/steps/mail/sendmail.inc
parent49afbf5d698eb7d57ae10a553b6dcb14117727dd (diff)
Better support for Courier IMAP
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 2172accc8..61821261d 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -216,10 +216,20 @@ if ($CONFIG['sent_mbox'])
// check if mailbox exists
if (!in_array_nocase($CONFIG['sent_mbox'], $IMAP->list_mailboxes()))
- $IMAP->create_mailbox($CONFIG['sent_mbox'], TRUE);
+ $mbox = $IMAP->create_mailbox($CONFIG['sent_mbox'], TRUE);
+ else
+ $mbox = TRUE;
// append message to sent box
- $saved = $IMAP->save_message($CONFIG['sent_mbox'], $header_str."\r\n".$msg_body);
+ if ($mbox)
+ $saved = $IMAP->save_message($CONFIG['sent_mbox'], $header_str."\r\n".$msg_body);
+
+ // raise error if saving failed
+ if (!$saved)
+ raise_error(array('code' => 800,
+ 'type' => 'imap',
+ 'file' => __FILE__,
+ 'message' => "Could not save message in $CONFIG[sent_mbox]"), TRUE, FALSE);
}