r91662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91661‎ | r91662 | r91663 >
Date:18:03, 7 July 2011
Author:mah
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -159,6 +159,7 @@
160160 }
161161
162162 $headers['From'] = $from->toString();
 163+ $headers['Return-Path'] = $from->toString();
163164
164165 if ( $wgEnotifImpersonal ) {
165166 $headers['To'] = 'undisclosed-recipients:;';

Follow-up revisions

RevisionCommit summaryAuthorDate
r99950* Send "undisclosed-recipients" in "To" header when sending the mail to more ...ialex12:39, 16 October 2011

Status & tagging log