Commit 4d5504d6 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 304999: Emails not generating Date header for non-sendmail methods - Patch…

Bug 304999: Emails not generating Date header for non-sendmail methods - Patch by Brion Vibber <brion@pobox.com> r=glob a=mkanat
parent cdab862a
...@@ -41,6 +41,8 @@ use Bugzilla::Constants; ...@@ -41,6 +41,8 @@ use Bugzilla::Constants;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Util; use Bugzilla::Util;
use Date::Format qw(time2str);
use Encode qw(encode); use Encode qw(encode);
use Email::MIME; use Email::MIME;
# Loading this gives us encoding_set. # Loading this gives us encoding_set.
...@@ -89,6 +91,11 @@ sub MessageToMTA { ...@@ -89,6 +91,11 @@ sub MessageToMTA {
$hostname = $1; $hostname = $1;
$from .= "\@$hostname" if $from !~ /@/; $from .= "\@$hostname" if $from !~ /@/;
$email->header_set('From', $from); $email->header_set('From', $from);
# Sendmail adds a Date: header also, but others may not.
if (!defined $email->header('Date')) {
$email->header_set('Date', time2str("%a, %e %b %Y %T %z", time()));
}
} }
if ($method eq "SMTP") { if ($method eq "SMTP") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment