This commit has been accessed 655 times via Git panel.
commit e2d6e639925ad21ec537953b38d9061abdb7958a
tree adb975737ad08e96ac429b8a0c0364c10b83b6a8
parent 8ebeba5da71d955cda8009a6b5159adc2a68c55c
author Engels Antonio <engels@majcms.org> 1333017270 +0800
committer Engels Antonio <engels@majcms.org> 1333017270 +0800
Override default envelope sender with From: address
diff --git a/index.php b/index.php
index 1434ec3..7acd969 100644
--- a/index.php
+++ b/index.php
@@ -927,7 +927,9 @@ if (isset($_SESSION['logged_uid'])) {
imap_append($mbox,"{$host}Sent","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
- mail($reply_to, $reply_subj, $reply_body, $reply_headers);
+ $reply_fenv = extract_emails_from($reply_from);
+
+ mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
if ($_POST['ack'] == 1) {
diff --git a/read.php b/read.php
index 1cb91d2..9fb9e33 100644
--- a/read.php
+++ b/read.php
@@ -387,7 +387,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
//echo nl2br(htmlentities(imap_fetchheader($mbox,$msgno)));
//echo nl2br(htmlentities(imap_body($mbox,$msgno)));
- echo $msgBody;
+ $get_fromaddress = extract_emails_from($header->fromaddress);
+ $get_fromaddress = explode("@",$get_fromaddress[0]);
+
+ if ($get_fromaddress[0] == "MAILER-DAEMON") {
+ echo nl2br(htmlentities(imap_body($mbox,$msgno)));
+ }
+ else {
+ echo $msgBody;
+ }
echo "</div>";
tree adb975737ad08e96ac429b8a0c0364c10b83b6a8
parent 8ebeba5da71d955cda8009a6b5159adc2a68c55c
author Engels Antonio <engels@majcms.org> 1333017270 +0800
committer Engels Antonio <engels@majcms.org> 1333017270 +0800
Override default envelope sender with From: address
diff --git a/index.php b/index.php
index 1434ec3..7acd969 100644
--- a/index.php
+++ b/index.php
@@ -927,7 +927,9 @@ if (isset($_SESSION['logged_uid'])) {
imap_append($mbox,"{$host}Sent","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
- mail($reply_to, $reply_subj, $reply_body, $reply_headers);
+ $reply_fenv = extract_emails_from($reply_from);
+
+ mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
if ($_POST['ack'] == 1) {
diff --git a/read.php b/read.php
index 1cb91d2..9fb9e33 100644
--- a/read.php
+++ b/read.php
@@ -387,7 +387,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
//echo nl2br(htmlentities(imap_fetchheader($mbox,$msgno)));
//echo nl2br(htmlentities(imap_body($mbox,$msgno)));
- echo $msgBody;
+ $get_fromaddress = extract_emails_from($header->fromaddress);
+ $get_fromaddress = explode("@",$get_fromaddress[0]);
+
+ if ($get_fromaddress[0] == "MAILER-DAEMON") {
+ echo nl2br(htmlentities(imap_body($mbox,$msgno)));
+ }
+ else {
+ echo $msgBody;
+ }
echo "</div>";