summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-02-19 18:34:34 +0000
committerthomascube <thomas@roundcube.net>2006-02-19 18:34:34 +0000
commitf88d417c96119b8e50297b930b14fe6ff9a1c5ed (patch)
tree7fc906e485f9a716c0855000ee20cd017587e0ad /program/steps
parent0615a69974d0101d3159511d416bb2c75ffa1ad9 (diff)
Applied several patches
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/compose.inc3
-rw-r--r--program/steps/mail/sendmail.inc15
2 files changed, 15 insertions, 3 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 80f69b596..98e0a0a2a 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -59,6 +59,9 @@ if ($_GET['_reply_uid'] || $_GET['_forward_uid'])
$REPLY_MESSAGE = &$MESSAGE;
$_SESSION['compose']['reply_uid'] = $_GET['_reply_uid'];
$_SESSION['compose']['reply_msgid'] = $REPLY_MESSAGE['headers']->messageID;
+ $_SESSION['compose']['reference'] = $REPLY_MESSAGE['headers']->reference;
+ $_SESSION['compose']['references'] .= !empty($REPLY_MESSAGE['headers']->reference) ? ' ' : '';
+ $_SESSION['compose']['references'] .= $REPLY_MESSAGE['headers']->messageID;
if ($_GET['_all'])
$REPLY_MESSAGE['reply_all'] = 1;
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 0ec19a9e4..a520a5043 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -123,9 +123,11 @@ if (strlen($identity_arr['organization']))
if (strlen($identity_arr['reply-to']))
$headers['Reply-To'] = $identity_arr['reply-to'];
-if ($_SESSION['compose']['reply_msgid'])
+if (!empty($_SESSION['compose']['reply_msgid']))
$headers['In-Reply-To'] = $_SESSION['compose']['reply_msgid'];
+if (!empty($_SESSION['compose']['references']))
+ $headers['References'] = $_SESSION['compose']['references'];
if ($_POST['_priority'])
{
@@ -180,8 +182,12 @@ if (is_array($_FILES['_attachments']['tmp_name']))
$MAIL_MIME->addAttachment($filepath, $files['type'][$i], $files['name'][$i], TRUE);
+// chose transfer encoding
+$charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-15');
+$transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit';
+
// encoding settings for mail composing
-$message_param = array('text_encoding' => '8bit',
+$message_param = array('text_encoding' => $transfer_encoding,
'html_encoding' => 'quoted-printable',
'head_encoding' => 'quoted-printable',
'head_charset' => $message_charset,
@@ -190,8 +196,11 @@ $message_param = array('text_encoding' => '8bit',
// compose message body and get headers
$msg_body = $MAIL_MIME->get($message_param);
-$msg_subject = $headers['Subject'];
+$msg_subject = $headers['Subject'];
+global $MBSTRING;
+if ($MBSTRING&&function_exists( "mb_encode_mimeheader"))
+ $headers['Subject'] = mb_encode_mimeheader( $headers['Subject'],$message_charset);
// send thru SMTP server using cusotm SMTP library
if ($CONFIG['smtp_server'])