jenkins-bot has submitted this change and it was merged.

Change subject: Make messages RFC 5322 compliant
......................................................................


Make messages RFC 5322 compliant

Looks like the problem was with adding all the headers again using the
addCustomHeaders function by Mailgun. We need only the Return-Path from
$headers, and that needs to be set with setReplyToAddress()

Working with bouncehandler too, as the headers are appended correctly.

Bug: T130493
Change-Id: I99e7ba0526c47a541a14f5ab1b31bd645713a324
---
M MailgunHooks.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Parent5446: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MailgunHooks.php b/MailgunHooks.php
index 61ba017..44a40ff 100644
--- a/MailgunHooks.php
+++ b/MailgunHooks.php
@@ -45,10 +45,10 @@
                $message->setFromAddress( $from );
                $message->setSubject( $subject );
                $message->setTextBody( $body );
+               $message->setReplyToAddress( $headers['Return-Path'] );
 
-               foreach( $headers as $headerName => $headerValue ) {
-                       $message->addCustomHeader( $headerName, $headerValue );
-               }
+               $message->addCustomHeader( "X-Mailer", $headers['X-Mailer'] );
+               $message->addCustomHeader( "List-Unsubscribe", 
$headers['List-Unsubscribe'] );
 
                foreach( $to as $recip ) {
                        try {

-- 
To view, visit https://gerrit.wikimedia.org/r/289614
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I99e7ba0526c47a541a14f5ab1b31bd645713a324
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Mailgun
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Nemo bis <federicol...@tiscali.it>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to