Generate Date and Message-ID headers locally

This commit is contained in:
Ludwig Nussel 2016-05-12 17:28:08 +02:00
parent 84ba41de31
commit 741c3f19b4

View File

@ -27,6 +27,7 @@ import smtplib
from email.mime.text import MIMEText
import os
import sys
import email.utils
from optparse import OptionParser
parser = OptionParser()
@ -116,6 +117,8 @@ msg['Subject'] = 'New Tumbleweed snapshot %s released!'%version
msg['From'] = options.sender
msg['To'] = options.to
msg['Mail-Followup-To'] = options.to
msg['Date'] = email.utils.formatdate(localtime = 1)
msg['Message-ID'] = email.utils.make_msgid()
if options.dry:
print "sending ..."