Email addresses must not be encoded

RESOLVED FIXED in Bugzilla 4.4

Status

()

Bugzilla
Email Notifications
--
major
RESOLVED FIXED
a year ago
11 months ago

People

(Reporter: Stuart, Assigned: Frédéric Buclin)

Tracking

4.4.11
Bugzilla 4.4
Dependency tree / graph
Bug Flags:
approval5.0 +
blocking5.0.3 +
approval4.4 +
blocking4.4.12 +

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151102093252

Steps to reproduce:

Upgraded perl Encode from 2.78 to 2.80 (using Fedora 23 RPMs)
Using email submission method of sendmail, with exim 4.86.


Actual results:

Emails from my bugzilla installation started bouncing. Examining the bounces the mails were being sent to =?UTF-8?Q?stuart=40gmail=2Ecom?=@example.com


Expected results:

It appears as if exim doesn't currently understand internationalized
email addresses using MIME encoded words. So not seeing a valid domain
in the address it appends the local domain before forwarding it.

The reason I'm seeing this now appears to be linked to the upgrade of the
perl Encode library. For example:
perl -E 'use Encode; print encode("MIME-Q", "stuart\@gmail.com") . "\n";'
using version 2.78 produces:
stuart@gmail.com
while on 2.80:
=?UTF-8?Q?stuart=40gmail=2Ecom?=
(Assignee)

Updated

a year ago
Keywords: qawanted
Considering this seems to impact several releases of the upstream module, we should have a work-around.
Assignee: email-notifications → dylan
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Updated

a year ago
Duplicate of this bug: 1255328
(Assignee)

Comment 3

a year ago
I can confirm the issue with Encode 2.82. Using MIME-B or MIME-Header doesn't help.

@dan: you are the maintainer of the Encode module on CPAN. Could you tell us if this is a regression or an intentional change? If it's intentional, is there a way to fall back to the old behavior?
Keywords: qawanted
(Assignee)

Comment 4

a year ago
http://search.cpan.org/diff?from=Encode-2.78&to=Encode-2.80&w=1#lib/Encode/MIME/Header.pm

I suspect that the removal of

  if (   $word =~ /[^\x00-\x7f]/o ...

is responsible for this problem. It looks like headers are encoded in all cases.
Looks related to this: https://rt.cpan.org/Ticket/Display.html?id=111853

Also, heh, See Also doesn't support RT?
(Assignee)

Comment 6

a year ago
(In reply to Dylan William Hardison [:dylan] from comment #5)
> Also, heh, See Also doesn't support RT?

It does, if the MoreBugUrl extension is enabled.
Based on https://github.com/dankogai/p5-encode/issues/28, we might consider using https://metacpan.org/pod/MIME::EncWords
to handle encoding. 

As an immediate stopgap, we can specify (in Makefile.PL) that we need Encode < 2.80 for master,
and use the previous blacklisting feature for 5.0 branch.
(Assignee)

Comment 8

a year ago
The problem is on our side, not on Encode side, see https://rt.cpan.org/Public/Bug/Display.html?id=111853#txn-1611993. As stated there, and as correctly done in Email::MIME::Encode already, only the phrase must be encoded, not the email address itself. But in Bugzilla::MIME, we encode the whole string, including the email address. So we are doing it wrong.
Flags: blocking5.0.3+
Target Milestone: --- → Bugzilla 5.0
(Assignee)

Updated

a year ago
Summary: Email addresses now always being sent using internationalized format → Email addresses must not be encoded
(Assignee)

Comment 9

a year ago
Created attachment 8736340 [details] [diff] [review]
patch for master, v1

header_str_set() has special code which correctly encodes what must be encoded, and leaves alone what must not be encoded, such as email addresses, see http://cpansearch.perl.org/src/RJBS/Email-MIME-1.937/lib/Email/MIME/Encode.pm
Assignee: dylan → LpSolit
Status: NEW → ASSIGNED
Attachment #8736340 - Flags: review?(dkl)
(Assignee)

Comment 10

a year ago
Created attachment 8736347 [details] [diff] [review]
patch for 5.0, v1
Attachment #8736347 - Flags: review?(dkl)
(Assignee)

Updated

a year ago
Flags: blocking4.4.12?
(Assignee)

Comment 11

a year ago
Created attachment 8736873 [details] [diff] [review]
patch for 5.0, v1.1

|use Encode::MIME::Header| is required by attachment.cgi to alter $Encode::Encoding{'MIME-Q'}->{'bpl'}. This missing dependency has never been caught before because Bugzilla::MIME was (luckily?) loaded before view() in attachment.cgi.
Attachment #8736347 - Attachment is obsolete: true
Attachment #8736347 - Flags: review?(dkl)
Attachment #8736873 - Flags: review?(dkl)
(Assignee)

Comment 12

a year ago
Created attachment 8736874 [details] [diff] [review]
patch for master, v1.1
Attachment #8736340 - Attachment is obsolete: true
Attachment #8736340 - Flags: review?(dkl)
Attachment #8736874 - Flags: review?(dkl)
Comment on attachment 8736874 [details] [diff] [review]
patch for master, v1.1

Review of attachment 8736874 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8736874 - Flags: review?(dkl) → review+
Comment on attachment 8736873 [details] [diff] [review]
patch for 5.0, v1.1

Review of attachment 8736873 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8736873 - Flags: review?(dkl) → review+
Flags: approval5.0+
(Assignee)

Comment 15

a year ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   6c14fac..60299ec  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   aa5f64e..652ee91  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
(Assignee)

Updated

a year ago
Blocks: 1096384
Duplicate of this bug: 1269546
Dataloss (dropped email) qualifies for a backport in my opinion, unless there are architectural reasons that we can't.
Status: RESOLVED → REOPENED
Flags: blocking4.4.12? → blocking4.4.12+
Resolution: FIXED → ---
(Assignee)

Updated

a year ago
Target Milestone: Bugzilla 5.0 → Bugzilla 4.4
(Assignee)

Comment 18

a year ago
Created attachment 8749602 [details] [diff] [review]
patch for 4.4, v1
Attachment #8749602 - Flags: review?(dkl)

Comment 19

a year ago
JFTR, I've tested the tip of the 4.4 branch and can confirm it suffers from the issue (email bounce). I can also confirm that LpSolit's patch fixes this.
Comment on attachment 8749602 [details] [diff] [review]
patch for 4.4, v1

Review of attachment 8749602 [details] [diff] [review]:
-----------------------------------------------------------------

Confirmed fixed. r=dkl
Attachment #8749602 - Flags: review?(dkl) → review+
Flags: approval4.4+
(Assignee)

Comment 21

a year ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   01ad7ac..f630337  4.4 -> 4.4
Status: REOPENED → RESOLVED
Last Resolved: a year agoa year ago
Resolution: --- → FIXED

Comment 22

a year ago
Installed Bugzilla 5.0.3 today and I could verify the fix.

Updated

11 months ago
Duplicate of this bug: 1274954
(Assignee)

Updated

11 months ago
Blocks: 1000988
You need to log in before you can comment on or make changes to this bug.