diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-08-03 10:43:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-08-03 10:43:39 +0100 |
commit | aa3cbc91dbc7e0c1dd416b90d963d06f3e07738a (patch) | |
tree | 9753973f93964991d28feb62b08990c27364e3cb /perllib/FixMyStreet/App.pm | |
parent | 76f39991e1caf89e12e8bb8f49ba0a99df56f3dc (diff) |
Make sure Message-ID is set on outgoing messages.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 68bfc728b..beea8bb11 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -296,6 +296,10 @@ sub send_email { $email->header_set( ucfirst($_), $vars->{$_} ) for grep { $vars->{$_} } qw( to from subject); + $email->header_set( 'Message-ID', sprintf('<fms-%s-%s@%s>', + time(), unpack('h*', random_bytes(5, 1)), $c->config->{EMAIL_DOMAIN} + ) ); + # pass the email into mySociety::Email to construct the on the wire 7bit # format - this should probably happen in the transport instead but hohum. my $email_text = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email( |