From: Mark A. Hershberger Date: Thu, 7 Jul 2011 18:03:46 +0000 (+0000) Subject: Set envelope sender to the same as the From: address when PEAR mail is used. This... X-Git-Tag: 1.31.0-rc.0~29006 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=e41d79c12581d6d94ac17dc1ec1b78f0b8931a63;p=lhc%2Fweb%2Fwiklou.git Set envelope sender to the same as the From: address when PEAR mail is used. This is so that mail “bounces” to the expected place. 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 --- 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:;';