tests: make the emails sent by mail-check.py look less like spam

rspamd complains that these emails miss these headers
This commit is contained in:
Guillaume Girol 2024-11-23 12:00:00 +00:00
parent e901c56849
commit 9919033068

View File

@ -5,6 +5,7 @@ import uuid
import imaplib
from datetime import datetime, timedelta
import email
import email.utils
import time
RETRY = 100
@ -15,11 +16,16 @@ def _send_mail(smtp_host, smtp_port, smtp_username, from_addr, from_pwd, to_addr
"From: {from_addr}",
"To: {to_addr}",
"Subject: {subject}",
"Message-ID: {random}@mail-check.py",
"Date: {date}",
"",
"This validates our mail server can send to Gmail :/"]).format(
from_addr=from_addr,
to_addr=to_addr,
subject=subject)
subject=subject,
random=str(uuid.uuid4()),
date=email.utils.formatdate(),
)
retry = RETRY