fix(email): add required Date header to outbound mail
This commit is contained in:
committed by
Teknium
parent
a9033c9220
commit
75b460bc94
@@ -1075,6 +1075,7 @@ async def _send_email(extra, chat_id, message):
|
||||
"""Send via SMTP (one-shot, no persistent connection needed)."""
|
||||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
from email.utils import formatdate
|
||||
|
||||
address = extra.get("address") or os.getenv("EMAIL_ADDRESS", "")
|
||||
password = os.getenv("EMAIL_PASSWORD", "")
|
||||
@@ -1092,6 +1093,7 @@ async def _send_email(extra, chat_id, message):
|
||||
msg["From"] = address
|
||||
msg["To"] = chat_id
|
||||
msg["Subject"] = "Hermes Agent"
|
||||
msg["Date"] = formatdate(localtime=True)
|
||||
|
||||
server = smtplib.SMTP(smtp_host, smtp_port)
|
||||
server.starttls(context=ssl.create_default_context())
|
||||
|
||||
Reference in New Issue
Block a user