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
This commit is contained in:
Jeremy Stanley 2016-01-14 00:07:47 +00:00
parent 7a41c18798
commit 192414e957

View File

@ -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)