Last modified: 2013-10-23 18:17:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35087, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33087 - Error 5.1.7 (invalid address) when using exchange server as smtp relay
Error 5.1.7 (invalid address) when using exchange server as smtp relay
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Email (Other open bugs)
1.18.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-14 11:04 UTC by sephren
Modified: 2013-10-23 18:17 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description sephren 2011-12-14 11:04:58 UTC
Since i upgraded my MediaWiki installation to 1.18, it isn't able to send mails via my smtp relay anymore (MS Exchange Server), for example when creating an user (error message: 501 5.1.7 Invalid address). But it did work with 1.17 and before.

It works again when I change Line 59 of includes/UserMailer.php (second if clause in toString()) in a manner that forces the if clause to be false (included && 1 != 1). Therefore no user name appears in the from header and emails can be send.

I am aware that "wrong" FROM headers are a well-known problem (as seen in bug reports like  https://bugzilla.wikimedia.org/show_bug.cgi?id=4979 or https://bugzilla.wikimedia.org/show_bug.cgi?id=5494) and i am sure there is a really huge chance it isn't mediawikis fault. ;-)

Email is configured in LocalSettings.php by $wgSMTP.
Comment 1 Mark A. Hershberger 2011-12-14 18:50:00 UTC
What is in $wgSMTP?

Could you patch UserMailer.php using r95547 to see if that fixes your problem?
Comment 2 sephren 2011-12-15 08:38:29 UTC
I patched UserMailer.php with the follow up revision, but it didn't fix the problem: [SMTP: Invalid response code received from server (code: 501, response: 5.1.7 Invalid address)]

$wgSMTP leads to a SSL tunnel and contains:

$wgSMTP = array(
'host'     => "localhost",
'IDHost'   => "wiki.company.local",
'localhost' => "wiki.company.local",
'port'     => 15000,
'auth'     => false,
);

Mail Header used to look like this before the upgrade:

Received: from wiki.company.local (10.41.8.235) by VAVP1E1A.exchangeserver.de
 (10.41.0.27) with Microsoft SMTP Server id 8.3.137.0; Thu, 10 Nov 2011
 14:10:02 +0100
From: MediaWiki Mail <wiki@company.org>


Postfix Server on the same machine which uses the same tunnel/relay:

Received: from wiki.company.local (10.41.8.235) by VAVP1E1C.exchangeserver.de
 (10.41.0.5) with Microsoft SMTP Server id 8.3.137.0; Sat, 1 Oct 2011 23:30:34
 +0200
From: root <wiki@company.org>


Unfortunately i can't tell how mail headers look like now...
Comment 3 Gregor Hagedorn 2011-12-18 11:30:40 UTC
I am not sure the solution proposed above is indeed the correct one. Please also check this report on mediawiki discussion page:

http://www.mediawiki.org/w/index.php?title=Manual_talk:$wgSMTP&diff=0&oldid=429164

This looks to me like it is the source of this problem. We are using 1.18 behind and SMTP sender authentication verifying University Firewall and when switching to 1.18 all emails were blocked. We found a config: From must be ONLY an email, but not: "name" <emailname@organisation.org>. We were not sure whether this is a mediawiki bug or a problem with our mail infrastructure, so we did not report it, but I now think it is the first.

I confirm that in todays 1.18 SVN the code is still 
164: $headers['Return-Path'] = $from->toString();
whereas in 1.19 it is fixed in r99950 but not backported to 1.18 or 1.18wmf1.

Please tag for backporting the trunk to the 1.18 versions.
Comment 4 Antoine "hashar" Musso (WMF) 2012-02-15 14:29:42 UTC
Sounds like the Return-Path is the cause. The patch was merged in 1.18:

- $headers['Return-Path'] = $from->toString();
+ $headers['Return-Path'] = $from->address;

The former add the name, the later just the address. I have added a note (r111538à about this bug being fixed for the next 1.18.

It is unlikely we are going to release a 1.18.2 so you will have to add a hack meanwhile.

1.19 will have the patch (release note added with r111539).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links