| | |
| | | } |
| | | else |
| | | { |
| | | /* |
| | | We need to replace mime_content_type in a later release because the function |
| | | is deprecated in favour of File_Info |
| | | */ |
| | | $ctype = rc_mime_content_type($attachment['path'], $attachment['mimetype']); |
| | | $ctype = str_replace('image/pjpeg', 'image/jpeg', $ctype); // #1484914 |
| | | $ctype = str_replace('image/pjpeg', 'image/jpeg', $attachment['mimetype']); // #1484914 |
| | | |
| | | // .eml attachments send inline |
| | | $MAIL_MIME->addAttachment($attachment['path'], |
| | |
| | | return; |
| | | } |
| | | |
| | | // set repliead flag |
| | | // set replied/forwarded flag |
| | | if ($_SESSION['compose']['reply_uid']) |
| | | $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED'); |
| | | else if ($_SESSION['compose']['forward_uid']) |
| | | $IMAP->set_flag($_SESSION['compose']['forward_uid'], 'FORWARDED'); |
| | | |
| | | } // End of SMTP Delivery Block |
| | | } // End of SMTP Delivery Block |
| | | |
| | | |
| | | |
| | |
| | | if ($olddraftmessageid) |
| | | { |
| | | // delete previous saved draft |
| | | $a_deleteid = $IMAP->search($CONFIG['drafts_mbox'],'HEADER Message-ID',$olddraftmessageid); |
| | | $deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0],$CONFIG['drafts_mbox']),$CONFIG['drafts_mbox']); |
| | | $a_deleteid = $IMAP->search($CONFIG['drafts_mbox'], 'HEADER Message-ID', $olddraftmessageid); |
| | | $deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0], $CONFIG['drafts_mbox']), $CONFIG['drafts_mbox']); |
| | | |
| | | // raise error if deletion of old draft failed |
| | | if (!$deleted) |
| | |
| | | |
| | | if ($savedraft) |
| | | { |
| | | $msgid = strtr($message_id, array('>' => '', '<' => '')); |
| | | |
| | | // remember new draft-uid |
| | | $draftids = $IMAP->search($CONFIG['drafts_mbox'], 'HEADER Message-ID', $msgid); |
| | | $_SESSION['compose']['param']['_draft_uid'] = $IMAP->get_uid($draftids[0], $CONFIG['drafts_mbox']); |
| | | |
| | | // display success |
| | | $OUTPUT->show_message('messagesaved', 'confirmation'); |
| | | |
| | | // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning |
| | | $OUTPUT->command('set_draft_id', str_replace(array('<','>'), "", $message_id)); |
| | | $OUTPUT->command('set_draft_id', $msgid); |
| | | $OUTPUT->command('compose_field_hash', true); |
| | | |
| | | // start the auto-save timer again |