remove the CRLF Email::MIME workaround when >= 1.911 is installed

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gozer, Assigned: gozer)

Tracking

Production

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Created attachment 8688966 [details] [diff] [review]
bugzilla-email-mime-crlf.patch

Bugzilla has a work-around in it's usage of Email::MIME, ensuring RFC2822 compliance with CRLF line endings.

However, since Email::MIME 1.911, the issue has been resolved.

Feels like the best thing to do would be to bump up the requirements to a newer version of Email::MIME without the bug and remove the workaround.

However, right now, attaching a small patch that makes the workaround conditional on the installed version of Email::MIME, so it should be forward-compatible.
Comment on attachment 8688966 [details] [diff] [review]
bugzilla-email-mime-crlf.patch

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

::: Bugzilla/Mailer.pm
@@ +80,5 @@
>          # you're running on. See http://perldoc.perl.org/perlport.html#Newlines
>          # We check for multiple CRs because of this Template-Toolkit bug:
>          # https://rt.cpan.org/Ticket/Display.html?id=43345
> +
> +        if ($Email::MIME::VERSION < 1.911) {

versions aren't real numbers - use vers_cmp() from Bugzilla::Install::Util instead

@@ +81,5 @@
>          # We check for multiple CRs because of this Template-Toolkit bug:
>          # https://rt.cpan.org/Ticket/Display.html?id=43345
> +
> +        if ($Email::MIME::VERSION < 1.911) {
> +          $msg =~ s/(?:\015+)?\012/\015\012/msg;

bugzilla uses 4 spaces for indentation
Attachment #8688966 - Flags: review-
Assignee: nobody → gozer
Summary: Email::MIME >= 1.911 fixes the CRLF issue → remove the CRLF Email::MIME workaround when >= 1.911 is installed
(Assignee)

Comment 2

3 years ago
Created attachment 8688978 [details] [diff] [review]
bugzilla-email-mime-crlf-v2.patch
Attachment #8688966 - Attachment is obsolete: true

Updated

3 years ago
Attachment #8688978 - Flags: review?(dkl)
Comment on attachment 8688978 [details] [diff] [review]
bugzilla-email-mime-crlf-v2.patch

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

Looks good. will commit. r=dkl

::: Bugzilla/Mailer.pm
@@ +80,5 @@
>          # directly because Perl translates "\n" depending on what platform
>          # you're running on. See http://perldoc.perl.org/perlport.html#Newlines
>          # We check for multiple CRs because of this Template-Toolkit bug:
>          # https://rt.cpan.org/Ticket/Display.html?id=43345
> +

we can remove the extra new line.
Attachment #8688978 - Flags: review?(dkl) → review+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   0f13163..3665280  master -> master
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.