Page MenuHomePhabricator

mail() call should specify -f option in addition to From header
Open, LowPublic

Description

Author: agaffney

Description:
I have an address on a mail server where postfix's sender address verification
is in use. Even though I have $wgPasswordSender set to a real email address, the
Return-Path still ends up as apache@mydomain.com. When the postfix server with
sender address verification receives the mail, it connects back to my server
which then informs it that apache@ can't receive mail. This causes the mail to
be rejected.

My "solution" to the problem was to add a fifth parameter to the call to mail()
in includes/UserMailer.php:

"-f " . $from->toString()

This causes the Return-Path header to match the From header, which allows it to
pass sender address verification when set to a valid email address.

I actually had the same issue when trying to create an account on this bugzilla.
I never got the password email. When I had my account excluded from the sender
address verification, I was able to get the "Forgot password" email just fine.


Version: 1.6.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz6147

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:18 PM
bzimport set Reference to bz6147.
bzimport added a subscriber: Unknown Object (MLST).

Note that you can set this in php.ini (or, probably, with
ini_set())

  • Bug 23838 has been marked as a duplicate of this bug. ***

avbidder wrote:

Needs to be documented then. Not everybody who needs MediaWiki knows PHP ini parameters.