SendEmail A/T reactor broken for recent version of Encode::MIME::Header

Bug #1801163 reported by Galen Charlton
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.3
Fix Released
High
Unassigned
3.5
Fix Released
High
Unassigned

Bug Description

The approach introduced in commit d88e3624ea4 (see bug 1031335) to MIME-encode headers does not work when using recent versions of Encode::MIME::Header. Specifically, Encode::MIME::Header 2.22 or later, which is part of Encode 2.83 or later, adopts a much stricter view of its task and does not work for structured header fields like To or From.

In particular, older versions of Encode::MIME::Header would yield results like this:

From: stuff <email address hidden>

while newer version give you something like

From: =?UTF-8?B?c3R1ZmYgPGZvb0BiYXIuY29t?=

Email::Send chokes on the latter when it tries to determine the sender address to use for the SMTP transaction.

Since the maintainers of Encode::MIME::Header are unwilling (see https://github.com/dankogai/p5-encode/issues/105) to make it handle structured headers in a more "bug-compatible" fashion, we'll need to do something else. Email::MIME or Email::Stuffer both look promising.

Marking this high importance because it's evident that there's at least one case where an innocent upgrade of Encode results in breaking outgoing A/T email.

Evergreen 3.1+

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I want to point out related bug 1466502, and bug 1362260 which took the approach of installing Email::Send from CPAN.

Perhaps an alternate solution is to finally switch to Email::Sender?

Revision history for this message
Galen Charlton (gmc) wrote :

I think the issues are orthogonal, as at first glance Email::Sender still needs something like Email::MIME to generate a correctly formatted (and escaped) email to send.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

OK, Galen, I see you point after reading through the Github issue.

I want to add that it looks like this issue will affect Ubuntu 18.04 support. I'm willing to work on this at the Hack-A-Way next week. My Ubuntu 18.04 VM has Encode version 2.88 and Perl 5.26.

Revision history for this message
Galen Charlton (gmc) wrote :

Thanks! It occurs to me that dealing with Email::Sender at or around the same would be a good idea; if we end up adding a dependency on Email::MIME or Email::Stuffer, we may as well stack up other dependency changes.

Changed in evergreen:
assignee: nobody → Jason Stephenson (jstephenson)
Changed in evergreen:
status: New → In Progress
Changed in evergreen:
milestone: none → 3.3-beta1
Revision history for this message
Jason Stephenson (jstephenson) wrote :

I have pushed a branch to the working repository that resolves this issue in my testing (see the commit message for a test procedure).

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dyrcona/lp1801163-email-mime

Since this branch adds prerequisites, I hesitate to say this should be backported to 3.2 or earlier releases.

Changed in evergreen:
status: In Progress → Confirmed
assignee: Jason Stephenson (jstephenson) → nobody
tags: added: pullrequest
Jeff Godin (jgodin)
Changed in evergreen:
assignee: nobody → Jeff Godin (jgodin)
Changed in evergreen:
milestone: 3.3-beta1 → 3.3-rc
Changed in evergreen:
milestone: 3.3-rc → 3.3.1
Changed in evergreen:
milestone: 3.3.1 → 3.3.2
Changed in evergreen:
milestone: 3.3.2 → 3.3.3
Changed in evergreen:
milestone: 3.3.3 → 3.3.4
Changed in evergreen:
milestone: 3.3.4 → 3.3.5
Changed in evergreen:
milestone: 3.3.5 → 3.4.2
Galen Charlton (gmc)
Changed in evergreen:
assignee: Jeff Godin (jgodin) → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

I've tested and pushed a signoff to user/gmcharlt/lp1801163_email_mime_signoff.

The signoff branch contains two follow-ups:

[1] Adding the new dependencies to the Buster and Fedora installation. I've not actually tested the Fedora part, though.
[2] Ensure that non-ASCII characters in the headers don't get mangled.

Since without this bugfix SendEmail appears to be completely broken on (at least) Debian Stretch and later and Ubuntu 18.04 and later, I think we'll need to bite the bullet and backport this.

tags: added: signedoff
Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
Jason Boyer (jboyer)
Changed in evergreen:
assignee: nobody → Jason Boyer (jboyer)
Changed in evergreen:
assignee: Jason Boyer (jboyer) → Jason Stephenson (jstephenson)
assignee: Jason Stephenson (jstephenson) → nobody
assignee: nobody → Jason Boyer (jboyer)
Revision history for this message
Jason Boyer (jboyer) wrote :

I've given this one last once-over and all of the silly unicode that I threw in my template ended up in my inbox. Pushed to master, rel_3_4, and rel_3_3.

Thanks Jason and Galen.

Changed in evergreen:
assignee: Jason Boyer (jboyer) → nobody
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.