summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Mailer.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index d5ecb5a38..e0f598b3d 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -41,6 +41,8 @@ use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Util;
+use Date::Format qw(time2str);
+
use Encode qw(encode);
use Email::MIME;
# Loading this gives us encoding_set.
@@ -89,6 +91,11 @@ sub MessageToMTA {
$hostname = $1;
$from .= "\@$hostname" if $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") {