From 4bdbe330ed162fe4b29be0f85dbc64c00fea9d34 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 16 Feb 2016 00:26:53 +0100 Subject: Properly encode From header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugzilla emails could have been rejected because the From header was not properly encoded (for example when containing "é" characters): Oct 25 12:08:43 alamut postfix/smtp[7614]: 0F85B5AD2B: to=, relay=eforward3.registrar-servers.com[38.101.213.206]:25, delay=2.7, delays=0.01/0/0.99/1.7, dsn=5.0.0, status=bounced (host eforward3.registrar-servers.com[38.101.213.206] said: 550 From contains invalid characters. (in reply to end of DATA command)) --- Extension.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Extension.pm b/Extension.pm index 4141e7c..6212367 100644 --- a/Extension.pm +++ b/Extension.pm @@ -15,6 +15,7 @@ use Bugzilla::User; use Bugzilla::Extension::Mageia::Util; use Email::Address; +use Encode qw(encode); our $VERSION = '0.10'; @@ -87,7 +88,7 @@ sub mailer_before_send { $changer = Bugzilla::User->new({ name => $changer }); my $changer_name = $changer ? $changer->name : undef; my $address = Email::Address->new($changer_name, $email->header('From')); - $email->header_set('From', $address->format); + $email->header_set('From', encode("MIME_Header", $address->format)); } } -- cgit v1.2.1