From 0d4e4201e061d05c895246272f833c18cd3ad38d Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 23 Oct 2014 04:35:42 -0700 Subject: [PATCH] Added constant for mail-id header. --- class2.php | 5 +++++ e107_admin/mailout.php | 1 + e107_handlers/bounce_handler.php | 6 +++--- e107_handlers/mail.php | 7 +++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/class2.php b/class2.php index 213e0dd73..0262854f1 100644 --- a/class2.php +++ b/class2.php @@ -724,6 +724,11 @@ else define('XURL_VIMEO', false); } +if(!defined('MAIL_IDENTIFIER')) +{ + define('MAIL_IDENTIFIER', 'X-e107-id'); +} + /* Withdrawn 0.8 // legacy module.php file loading. if (isset($pref['modules']) && $pref['modules']) { diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index 1287deb54..9a6d1c041 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -447,6 +447,7 @@ class mailout_main_ui extends e_admin_ui $sendto = trim($_POST['testaddress']); $eml = array( + 'e107_header' => 9999999, 'subject' => LAN_MAILOUT_113." ".$add, 'body' => str_replace("[br]", "\n", LAN_MAILOUT_114), 'template' => vartrue($_POST['testtemplate'],null), diff --git a/e107_handlers/bounce_handler.php b/e107_handlers/bounce_handler.php index 8386cdcc4..c90f06ec2 100644 --- a/e107_handlers/bounce_handler.php +++ b/e107_handlers/bounce_handler.php @@ -44,8 +44,8 @@ class e107Bounce $head = BounceHandler::parse_head($strEmail); $message = null; - - $e107_userid = (isset($head['X-e107-id'])) ? $head['X-e107-id'] : $this->getHeader($strEmail,'X-e107-id'); + $identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id'); + $e107_userid = (isset($head[$identifier])) ? $head[$identifier] : $this->getHeader($strEmail, $identifier); if($_E107['debug']) { @@ -97,7 +97,7 @@ class e107Bounce foreach($multiArray as $the) { - $the['user_id'] = $head['X-e107-id']; + $the['user_id'] = $head[$identifier]; $the['user_email'] = $the['recipient']; unset($the['recipient']); diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index a3d20c12f..4ecdc91cf 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -753,11 +753,12 @@ class e107Email extends PHPMailer print_a($eml); } + $identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id'); if (vartrue($eml['returnreceipt'])) $this->ConfirmReadingTo = $eml['returnreceipt']; if (vartrue($eml['inline_images'])) $this->addInlineImages($eml['inline_images']); if (vartrue($eml['priority'])) $this->Priority = $eml['priority']; - if (vartrue($eml['e107_header'])) $this->AddCustomHeader("X-e107-id: {$eml['e107_header']}"); + if (vartrue($eml['e107_header'])) $this->AddCustomHeader($identifier.": {$eml['e107_header']}"); if (vartrue($eml['extra_header'])) { if (is_array($eml['extra_header'])) @@ -1119,8 +1120,10 @@ function sendemail($send_to, $subject, $message, $to_name='', $send_from='', $fr // Create a mailer object of the correct type (which auto-fills in sending method, server details) $mail = new e107Email($overrides); + + $identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id'); - if (varsettrue($mailheader_e107id)) $mail->AddCustomHeader("X-e107-id: {$mailheader_e107id}"); + if (varsettrue($mailheader_e107id)) $mail->AddCustomHeader($identifier.": {$mailheader_e107id}"); $mail->legacyBody = TRUE; // Need to handle plain text email conversion to HTML $mail->makeBody($message); // Add body, with conversion if required