From 192414e9573f211b6b2b203733c5fafae11b9b26 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 14 Jan 2016 00:07:47 +0000 Subject: [PATCH] Add Date and Message-ID to summit invites The mail merger for summit invites includes Date and Message-ID headers, because Crocker said so in 1977 that's why. Change-Id: I2105fe4cd04b7b2042c9e32888cb1f094697d7bf --- tools/invite2summit/send.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/invite2summit/send.py b/tools/invite2summit/send.py index 567c6a8561..bee63688c3 100644 --- a/tools/invite2summit/send.py +++ b/tools/invite2summit/send.py @@ -16,6 +16,7 @@ # under the License. import csv +import email.utils import settings import smtplib import sys @@ -66,9 +67,20 @@ if __name__ == '__main__': content = template.substitute(name=committer.name, code=code, signature=settings.EMAIL_SIGNATURE) - msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" % ( - settings.EMAIL_FROM, ','.join(committer.emails), - settings.EMAIL_SUBJECT, content) + msg = ( + "From: %s\r\n" + "To: %s\r\n" + "Date: %s\r\n" + "Message-ID: %s\r\n" + "Subject: %s\r\n" + "%s" + % ( + settings.EMAIL_FROM, + ','.join(committer.emails), + email.utils.formatdate(), + email.utils.make_msgid(), + settings.EMAIL_SUBJECT, + content)) session.sendmail(settings.EMAIL_FROM, committer.emails, msg) print "%s,ATC,%s" % (code, committer.name)