Closed Bug 728408 Opened 13 years ago Closed 12 years ago

Use Email::MIME::Header::header_raw vice Email::MIME::header if data might be non-ASCII

Categories

(Bugzilla :: Email Notifications, defect)

defect
Not set
minor

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: dmarshall, Assigned: dmarshall)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Mailer.pm patch (obsolete) — Splinter Review
I use mail delivery mode Test for my development, and we put user names into the From: line, so I discovered a problem. Even though a From: with non-ASCII was being properly encoded for MIME-Q, it wasn't in my testfile as such! This is because Email::MIME::Header::header decodes the value, but header_raw does not. If using Sendmail, this is not a problem, but if not using Sendmail, Mailer.pm does a header_set with the decoded value! To reproduce, use a mail delivery method other than 'Sendmail', and send a mail with a non-ASCII From: through MessageToMTA. Expected result: a quoted-printable From:, actual result: a non-encoded From:.
Attached patch corrected diffSplinter Review
After some thought, only the setting of $from should be the raw header, because it's what might be put into a mail without further encoding.
Attachment #598364 - Attachment is obsolete: true
Attachment #598368 - Flags: review?(wicked)
Attachment #598368 - Flags: review?(mkanat)
Comment on attachment 598368 [details] [diff] [review] corrected diff r=gerv; works as billed. Gerv
Attachment #598368 - Flags: review?(mkanat) → review+
Flags: approval?
Comment on attachment 598368 [details] [diff] [review] corrected diff Hmm, not sure why I'm still asked to review this patch since gerv got it. Maybe it was just left here accidentally, but I took a quick look anyway. I do have few questions I would have answered during my review testing. Asking them here, just to be sure we don't break things just because I don't voice my concerns. :) Gerv, did you test this with both Sendmail and non-Sendmail mailer method? Does Email::Parse handle QP-encoding correctly (for extracting the email address for -f Sendmail switch)? What happens if From is encoded and non-Sendmail mailer tries to add the hostname? Does it get added twice, if the @-character is encoded? Interesting, I fail to find header_obj methdod in the Email::MIME or Email::Simple man pages. Gerv, I hope you don't mind me asking these questions. I do appreciate that you took the time to review this, when I failed to. :( (My todo list entry to go trought my reviews is 100 days old tomorrow..)
Attachment #598368 - Flags: review?(wicked)
I've tested this in both Sendmail and non-Sendmail. Email::MIME >= 1.861 requires Email::Simple >= 2.003, and header_obj is present in those versions. The pertinent question is whether, if the email headers have been encoded, if $from should be decoded. I argue that it shouldn't be. It is worth testing whether the hostname gets added if the @ is encoded. I'll look into that and report back.
Assignee: email-notifications → dmarshal
Severity: normal → minor
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
(In reply to David Marshall from comment #4) > The pertinent question is whether, if the email headers have been encoded, > if $from should be decoded. I argue that it shouldn't be. > > It is worth testing whether the hostname gets added if the @ is encoded. > I'll look into that and report back. 2 months later, still no feedback from dwm. Still holding approval.
dwm: ping? LpSolit: if we don't hear from dwm, what happens? Gerv
(In reply to Gervase Markham [:gerv] from comment #6) > LpSolit: if we don't hear from dwm, what happens? Nothing. Just ignore the bug. I don't want to take a patch which hasn't been fully tested, especially when related to emails.
Resolving INCOMPLETE due to lack of info. Gerv
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
Flags: approval?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: