Last modified: 2012-05-03 02:42:50 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 T36421, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34421 - mutiple headers in emails from UserMailer
mutiple headers in emails from UserMailer
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Email (Other open bugs)
1.19
All All
: High normal (vote)
: 1.19.0 release
Assigned To: Antoine "hashar" Musso (WMF)
: patch, patch-need-review, platformeng
: 34435 34464 34479 (view as bug list)
Depends on:
Blocks: 31217
  Show dependency treegraph
 
Reported: 2012-02-15 18:12 UTC by Mark A. Hershberger
Modified: 2012-05-03 02:42 UTC (History)
7 users (show)

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


Attachments
To header patch (38 bytes, text/plain)
2012-02-17 19:00 UTC, Alex Monk
Details
Actual patch (732 bytes, patch)
2012-02-17 19:14 UTC, Alex Monk
Details
Previous patch + PEAR Subject header fix. (985 bytes, patch)
2012-02-17 22:20 UTC, Alex Monk
Details

Description Mark A. Hershberger 2012-02-15 18:12:07 UTC
From some examples:

To: mah@everybody.org
Subject: Wikipedia e-mail from user "MarkAHershberger"
From: MarkAHershberger <mah@everybody.org>
To: MarkAHershberger <mah@everybody.org>
Subject: Wikipedia e-mail from user "MarkAHershberger"

To: mah@everybody.org
Subject: Copy of your message to Saibo: Wikipedia e-mail from user "MarkAHershberger"
From: MarkAHershberger <mah@everybody.org>
To: MarkAHershberger <mah@everybody.org>
Subject: Copy of your message to Saibo: Wikipedia e-mail from user "MarkAHershberger"

Two "To:" and "Subject:" headers
Comment 1 Michael Movchin 2012-02-15 18:30:52 UTC
I'm sorry, I couldn't reproduce it. The Mail Header I got:

Return-Path: <wiki@wikimedia.org>
Delivery-Date: Sun, 12 Feb 2012 16:39:24 +0100
Received: from wiki-mail.wikimedia.org (wiki-mail.wikimedia.org [208.80.152.133])
	by xxxxxxxxxxx (node=mxeu2) with ESMTP (Nemesis)
	id xxxxxxxxxxx for michael@movchin.de; Sun, 12 Feb 2012 16:39:24 +0100
Received: from mw4.pmtpa.wmnet ([10.0.11.4]:38825)
	by mchenry.wikimedia.org with esmtp (Exim 4.69)
	(envelope-from <wiki@wikimedia.org>)
	id xxxxxxxxxxx
	for michael@movchin.de; Sun, 12 Feb 2012 15:39:23 +0000
Received: from apache by mw4.pmtpa.wmnet with local (Exim 4.71)
	id xxxxxxxxxxx
	for michael@movchin.de; Sun, 12 Feb 2012 15:39:23 +0000
Date: Sun, 12 Feb 2012 15:39:23 +0000
Message-Id: <xxxxxxxxxxx@mw4.pmtpa.wmnet>
To: Mmovchin <michael@movchin.de>
Subject: Wikipedia-E-Mail
MIME-Version: 1.0
Content-type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Mailer: MediaWiki mailer
From: xxxxxxxxxxx <xxxxxxxxxxx@xxxxx.xx>
Envelope-To: michael@movchin.de
Comment 2 Mark A. Hershberger 2012-02-15 19:09:54 UTC
this was on test2, so it is the not-yet-released 1.19 software
Comment 3 Max Semenik 2012-02-16 10:46:41 UTC
*** Bug 34435 has been marked as a duplicate of this bug. ***
Comment 4 Antoine "hashar" Musso (WMF) 2012-02-16 16:38:19 UTC
I do confirm this issue. marking for 1.19 deployement.
Comment 5 Antoine "hashar" Musso (WMF) 2012-02-16 16:55:26 UTC
I have bisected the issue to includes/UserMailer.php at revision r93397 by mah who is also the reporter of this bug :-)

At previous r93279 we have no issue.
Comment 6 Antoine "hashar" Musso (WMF) 2012-02-16 17:00:01 UTC
I am not taking the bug per see right now. If I do I will assign it to myself. So feel free to fix the issue :-)
Comment 7 Alex Monk 2012-02-16 17:07:23 UTC
I'm guessing that this is caused by setting $headers['To'] instead of changing mail's first parameter (recipient/to).
Comment 8 Mark A. Hershberger 2012-02-17 15:11:04 UTC
*** Bug 34464 has been marked as a duplicate of this bug. ***
Comment 9 Antoine "hashar" Musso (WMF) 2012-02-17 17:02:51 UTC
subject header dealt with r111765
Comment 10 Antoine "hashar" Musso (WMF) 2012-02-17 17:06:12 UTC
The To: header need a bit more investigation. Will attempt to poke at it tonight.
Comment 11 Alex Monk 2012-02-17 19:00:10 UTC
Created attachment 10032 [details]
To header patch

I'm completely new to this so forgive me if I'm doing something wrong here, but I think I fixed the To header. It appears to work on my local setup without $wgSMTP.
Comment 12 Sumana Harihareswara 2012-02-17 19:01:35 UTC
Thanks for the patch, Alex!  I added

need-review

and

patch

as keywords here to indicate that you've attached a patch that needs review.  Hope to get a developer to review this soon.  Thanks again!
Comment 13 Alex Monk 2012-02-17 19:14:39 UTC
Created attachment 10034 [details]
Actual patch

So AttachURL didn't quite work how I was expecting. This should be the actual patch.
Comment 14 Sam Reed (reedy) 2012-02-17 19:28:12 UTC
*** Bug 34479 has been marked as a duplicate of this bug. ***
Comment 15 Alex Monk 2012-02-17 22:20:40 UTC
Created attachment 10036 [details]
Previous patch + PEAR Subject header fix.

r111765 broke the Subject header when using PEAR, so this patch does the same thing as my last one, but *should* (untested) fix that.
Comment 16 Antoine "hashar" Musso (WMF) 2012-02-18 15:37:48 UTC
Alex: thanks for your patches, that gave me some ideas to properly fix this issue. I have send the change as r111832. Comments inside the source code give some explanations.

To: and Subject: headers need to be handled differently depending upon the mailer we are going to use. 

To:

PHP mail() first argument is the mail receiver. The argument is used as a recipient destination and as a To header.

PEAR mailer has a recipient argument which is only used to send the mail. If no To header is given, PEAR will set it to to 'undisclosed-recipients:'.

NOTE: To: is for presentation, the actual recipient is specified by the mailer using the Rcpt-To: header.

Subject:  PHP mail() second argument to pass the subject, passing a Subject
 as an additional header will result in a duplicate header. 

PEAR mailer should be passed a Subject header. 


With r111832, mails sent to a single recipients will look alike with mail() or PEAR Mail.
For multiple recipients:
- php mail() will show the recipient email and 'undisclosed-recipients:'
- PEAR Mail will only show 'undisclosed-recipients:'

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


Navigation
Links