Send -bugs and -docs emails from noreply address

Sending from the submitters address runs afoul to DMARC and other
restrictions. Instead, send the email from a defined noreply address.
Instead, add the original submitter to both the Cc and the Reply-To
header, to make sure they receive followups.

Patch by Stephen, minor changes by Magnus
This commit is contained in:
Stephen Frost
2017-12-18 15:59:18 +01:00
committed by Magnus Hagander
parent 48aadf6815
commit dfd46afae4
7 changed files with 15 additions and 6 deletions

View File

@ -7,7 +7,7 @@ from email import encoders
from models import QueuedMail
def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None, usergenerated=False, cc=None):
def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None, usergenerated=False, cc=None, replyto=None):
# attachment format, each is a tuple of (name, mimetype,contents)
# content should be *binary* and not base64 encoded, since we need to
# use the base64 routines from the email library to get a properly
@ -18,6 +18,8 @@ def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None, userge
msg['From'] = sender
if cc:
msg['Cc'] = cc
if replyto:
msg['Reply-To'] = replyto
msg['Date'] = formatdate(localtime=True)
msg['Message-ID'] = make_msgid()