summaryrefslogtreecommitdiff
path: root/pgcommitfest/mailqueue/util.py
diff options
context:
space:
mode:
authorMagnus Hagander2014-07-15 10:57:17 +0000
committerMagnus Hagander2014-07-15 10:57:17 +0000
commit0aa96508ec8a30dbd47eb5f5d31eabeabfc3d9a9 (patch)
tree5d25d04d5a80ab02292f771ae1b4fd61c86a2e9a /pgcommitfest/mailqueue/util.py
parent4ef258394dbd79aebf63f3981700c6b305190bf5 (diff)
Include name of cf username causing emails to be sent in the headers
Diffstat (limited to 'pgcommitfest/mailqueue/util.py')
-rw-r--r--pgcommitfest/mailqueue/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pgcommitfest/mailqueue/util.py b/pgcommitfest/mailqueue/util.py
index f38272c..60afd5d 100644
--- a/pgcommitfest/mailqueue/util.py
+++ b/pgcommitfest/mailqueue/util.py
@@ -6,7 +6,7 @@ from email import encoders
from models import QueuedMail
-def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None):
+def send_simple_mail(sender, receiver, subject, msgtxt, sending_username, attachments=None):
# attachment format, each is a tuple of (name, mimetype,contents)
# content should already be base64 encoded
msg = MIMEMultipart()
@@ -14,6 +14,8 @@ def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None):
msg['To'] = receiver
msg['From'] = sender
msg['Date'] = formatdate(localtime=True)
+ msg['User-Agent'] = 'pgcommitfest'
+ msg['X-cfsender'] = sending_username
msg.attach(MIMEText(msgtxt, _charset='utf-8'))