mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2025-01-13 19:50:36 +05:00
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:
parent
e901c56849
commit
9919033068
@ -5,6 +5,7 @@ import uuid
|
|||||||
import imaplib
|
import imaplib
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import email
|
import email
|
||||||
|
import email.utils
|
||||||
import time
|
import time
|
||||||
|
|
||||||
RETRY = 100
|
RETRY = 100
|
||||||
@ -15,11 +16,16 @@ def _send_mail(smtp_host, smtp_port, smtp_username, from_addr, from_pwd, to_addr
|
|||||||
"From: {from_addr}",
|
"From: {from_addr}",
|
||||||
"To: {to_addr}",
|
"To: {to_addr}",
|
||||||
"Subject: {subject}",
|
"Subject: {subject}",
|
||||||
|
"Message-ID: {random}@mail-check.py",
|
||||||
|
"Date: {date}",
|
||||||
"",
|
"",
|
||||||
"This validates our mail server can send to Gmail :/"]).format(
|
"This validates our mail server can send to Gmail :/"]).format(
|
||||||
from_addr=from_addr,
|
from_addr=from_addr,
|
||||||
to_addr=to_addr,
|
to_addr=to_addr,
|
||||||
subject=subject)
|
subject=subject,
|
||||||
|
random=str(uuid.uuid4()),
|
||||||
|
date=email.utils.formatdate(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
retry = RETRY
|
retry = RETRY
|
||||||
|
Loading…
Reference in New Issue
Block a user