From e41d79c12581d6d94ac17dc1ec1b78f0b8931a63 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 7 Jul 2011 18:03:46 +0000 Subject: [PATCH] =?utf8?q?Set=20envelope=20sender=20to=20the=20same=20as?= =?utf8?q?=20the=20From:=20address=20when=20PEAR=20mail=20is=20used.=20=20?= =?utf8?q?This=20is=20so=20that=20mail=20=E2=80=9Cbounces=E2=80=9D=20to=20?= =?utf8?q?the=20expected=20place.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Note that this only works when $wgSMTP is set and (as a result) the PEAR mailer is used. When $wgSMTP is not set, the envelope sender is set using $wgAdditionalMailParams set to something like “-f from@example.com”. Someone should create some Envelope sender sanity in how the envelope sender is set. Suggestion: if $wgAdditionalMailParams is not set, then use $wgEmergencyContact to create “-f $wgEmergencyContact” for php mailer and to set the Return-Path header for PEAR mailer. I used “From:” for Return-Path here because it seemed most sensible. See also: http://pear.php.net/bugs/bug.php?id=5017 --- includes/UserMailer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 3fbf114def..0a7dc7f745 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -159,6 +159,7 @@ class UserMailer { } $headers['From'] = $from->toString(); + $headers['Return-Path'] = $from->toString(); if ( $wgEnotifImpersonal ) { $headers['To'] = 'undisclosed-recipients:;'; -- 2.20.1