When sending email add a Date: header so that amavis does not consider the emails to be spam

This commit is contained in:
Kovid Goyal 2011-10-12 04:40:51 +05:30
commit d9fc91c5c4

View File

@ -18,11 +18,13 @@ def create_mail(from_, to, subject, text=None, attachment_data=None,
assert text or attachment_data
from email.mime.multipart import MIMEMultipart
from email.utils import formatdate
outer = MIMEMultipart()
outer['Subject'] = subject
outer['To'] = to
outer['From'] = from_
outer['Date'] = formatdate(localtime=True)
outer.preamble = 'You will not see this in a MIME-aware mail reader.\n'
if text is not None: