mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-25 06:26:27 +01: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
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue