[phpmailer] Fixes Double Message ID #1020

Merged
nupplaphil merged 2 commits from bug/9142-message-id into 2020.09-rc 2020-09-20 04:11:15 +02:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 874cef6a19 - Show all commits

View file

@ -90,9 +90,12 @@ function phpmailer_emailer_send_prepare(App $a, IEmail &$email)
// additional headers
if (!empty($email->getAdditionalMailHeader())) {
foreach (explode("\n", trim($email->getAdditionalMailHeader())) as $header_line) {
list($name, $value) = explode(':', $header_line, 2);
$mailer->addCustomHeader(trim($name), trim($value));
foreach ($email->getAdditionalMailHeader() as $name => $values) {
// Skip the "Message-ID" header because PHP-Mailer is using its own
if ($name == 'Message-Id') {
continue;
}
$mailer->addCustomHeader(trim($name), trim(implode("\n", $values)));
}
}

View file

@ -54,6 +54,6 @@ class SecureTestEmail extends Email
parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'],
$subject, "<p>{$message}</p>", $message,
'', local_user());
[], local_user());
}
}