| | |
| | | $http_header .= $nldlm . ' via '; |
| | | } |
| | | |
| | | $host = $_SERVER['REMOTE_ADDR']; |
| | | $host = $_SERVER['REMOTE_ADDR']; |
| | | $hostname = gethostbyaddr($host); |
| | | |
| | | if ($encrypt) { |
| | |
| | | |
| | | $headers['Date'] = $RCMAIL->user_date(); |
| | | $headers['From'] = rcube_charset::convert($from_string, RCUBE_CHARSET, $message_charset); |
| | | $headers['To'] = $mailto; |
| | | $headers['To'] = $mailto; |
| | | |
| | | // additional recipients |
| | | if (!empty($mailcc)) { |
| | |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | } |
| | | |
| | | $dont_override = (array) $RCMAIL->config->get('dont_override'); |
| | | $mdn_enabled = in_array('mdn_default', $dont_override) ? $RCMAIL->config->get('mdn_default') : !empty($_POST['_mdn']); |
| | | $dsn_enabled = in_array('dsn_default', $dont_override) ? $RCMAIL->config->get('dsn_default') : !empty($_POST['_dsn']); |
| | | |
| | | // add subject |
| | | $headers['Subject'] = trim(rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE, $message_charset)); |
| | |
| | | } |
| | | } |
| | | |
| | | if (!empty($_POST['_receipt'])) { |
| | | if ($mdn_enabled) { |
| | | $headers['Return-Receipt-To'] = $from_string; |
| | | $headers['Disposition-Notification-To'] = $from_string; |
| | | } |
| | |
| | | $attachment = $RCMAIL->plugins->exec_hook('attachment_get', $attachment); |
| | | |
| | | if ($isHtml) { |
| | | $dispurl = '/\s(poster|src)\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' |
| | | . preg_quote($attachment['id']) . '[\s\'"]*/'; |
| | | $dispurl = '/[\'"]\S+display-attachment\S+file=rcmfile' . preg_quote($attachment['id']) . '[\'"]/'; |
| | | $message_body = $MAIL_MIME->getHTMLBody(); |
| | | $is_inline = preg_match($dispurl, $message_body); |
| | | } |
| | |
| | | $cid .= '@localhost'; |
| | | } |
| | | |
| | | $message_body = preg_replace($dispurl, ' \\1="cid:' . $cid . '" ', $message_body); |
| | | $message_body = preg_replace($dispurl, '"cid:' . $cid . '"', $message_body); |
| | | |
| | | $MAIL_MIME->setHTMLBody($message_body); |
| | | |
| | |
| | | } |
| | | |
| | | // Handle Delivery Status Notification request |
| | | if (!empty($_POST['_dsn'])) { |
| | | $smtp_opts['dsn'] = true; |
| | | } |
| | | $smtp_opts['dsn'] = $dsn_enabled; |
| | | |
| | | $sent = $RCMAIL->deliver_message($MAIL_MIME, $from, $mailto, |
| | | $smtp_error, $mailbody_file, $smtp_opts); |
| | |
| | | $store_target = $drafts_mbox; |
| | | } |
| | | else if (!$RCMAIL->config->get('no_save_sent_messages')) { |
| | | $store_target = rcube_utils::get_input_value('_store_target', rcube_utils::INPUT_POST); |
| | | if (!strlen($store_target)) { |
| | | if (isset($_POST['_store_target'])) { |
| | | $store_target = rcube_utils::get_input_value('_store_target', rcube_utils::INPUT_POST); |
| | | } |
| | | else { |
| | | $store_target = $RCMAIL->config->get('sent_mbox'); |
| | | } |
| | | } |
| | |
| | | else { |
| | | $folders = array(); |
| | | |
| | | if ($COMPOSE['mode'] == 'reply' || $COMPOSE['mode'] == 'forward') { |
| | | if (in_array($COMPOSE['mode'], array('reply', 'forward', 'draft'))) { |
| | | $folders[] = $COMPOSE['mailbox']; |
| | | } |
| | | |