From 520c36aa4c24ad3424b8fa3137b7576e6eacaf14 Mon Sep 17 00:00:00 2001 From: thomascube Date: Tue, 11 Oct 2005 21:11:42 +0000 Subject: Better support for Courier IMAP --- program/steps/mail/compose.inc | 7 ++++++- program/steps/mail/sendmail.inc | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 03f508be8..f65e4ff7b 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -403,7 +403,12 @@ function rcmail_compose_subject($attrib) // create a reply-subject else if (isset($REPLY_MESSAGE['subject'])) - $subject = 'Re: '.$REPLY_MESSAGE['subject']; + { + if (strpos($REPLY_MESSAGE['subject'], 'Re:')===0) + $subject = $REPLY_MESSAGE['subject']; + else + $subject = 'Re: '.$REPLY_MESSAGE['subject']; + } // create a forward-subject else if (isset($FORWARD_MESSAGE['subject'])) 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); } -- cgit v1.2.3