fix: e-mails carry a Date header, which spam filters expect
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m21s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Failing after 54s
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m21s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Failing after 54s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ import os
|
||||
import smtplib
|
||||
import ssl
|
||||
from email.message import EmailMessage
|
||||
from email.utils import formataddr, make_msgid, parseaddr
|
||||
from email.utils import formataddr, formatdate, make_msgid, parseaddr
|
||||
|
||||
ADAPTER = os.environ.get('MAIL_ADAPTER', 'off')
|
||||
RESET_MINUTES = 60
|
||||
@@ -102,6 +102,8 @@ def message(to, subject, body, html=None):
|
||||
msg['From'] = formataddr((name or 'DTF Dropstar', address))
|
||||
msg['To'] = to
|
||||
msg['Subject'] = subject
|
||||
# Neither EmailMessage nor smtplib adds it, and filters (Outlook's among them) count it missing.
|
||||
msg['Date'] = formatdate(localtime=True)
|
||||
msg['Message-ID'] = make_msgid(domain=address.split('@')[-1] or None)
|
||||
reply = os.environ.get('MAIL_REPLY_TO', '')
|
||||
if reply:
|
||||
|
||||
Reference in New Issue
Block a user