From acb3790a0fb16267e7e9a9bd53468c3dbe2e124a Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 14 Nov 2012 15:28:39 +0100 Subject: [PATCH] new option REWRITE_MESSAGE_ID enables you to rewrite the message-id of the restored message --- webui/config.php | 1 + webui/model/mail/mail.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/webui/config.php b/webui/config.php index 429108e8..6c67d21e 100644 --- a/webui/config.php +++ b/webui/config.php @@ -19,6 +19,7 @@ define('ENABLE_GOOGLE_LOGIN', 0); define('SEARCH_RESULT_CHECKBOX_CHECKED', 1); define('HELPER_URL', ''); define('ENABLE_SYSLOG', 0); +define('REWRITE_MESSAGE_ID', 0); define('GOOGLE_CLIENT_ID', 'xxxxxxxxxxx'); define('GOOGLE_CLIENT_SECRET', 'xxxxxxxxxxxxx'); define('GOOGLE_DEVELOPER_KEY', 'xxxxxxxxxxxx'); diff --git a/webui/model/mail/mail.php b/webui/model/mail/mail.php index 6c8fcf7a..5f2aa672 100644 --- a/webui/model/mail/mail.php +++ b/webui/model/mail/mail.php @@ -8,6 +8,10 @@ class ModelMailMail extends Model { if($to == "" || strlen($msg) < 30){ return $ok; } + if(REWRITE_MESSAGE_ID == 1) { + $msg = preg_replace("/Message-ID:([\ \w\_\-\@\<\>\.\r]+)\n/i", "Message-ID: <" . generate_random_string(25) . '@' . SITE_NAME . ">\n", $msg); + } + $r = fsockopen($smtphost, $smtpport); if(!$r){ return -1; }