From 7043cb556aac32a1ce83b1e9136dd9b9d63c3c55 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Tue, 7 Jul 2026 15:27:20 +0800 Subject: [PATCH] Add Message-ID header The Debian SMTP server doesn't set missing Message-ID, causing Outlook rejects such mail. Signed-off-by: Shengjing Zhu --- libpius/mailer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpius/mailer.py b/libpius/mailer.py index 87ce05d..02aca7f 100644 --- a/libpius/mailer.py +++ b/libpius/mailer.py @@ -7,7 +7,7 @@ import sys from email import message -from email.utils import formatdate +from email.utils import formatdate, make_msgid from email import mime from email.mime import multipart @@ -385,6 +385,7 @@ def _send_mail(self, to, msg): else: msg["To"] = to msg["Date"] = formatdate(localtime=True) + msg["Message-ID"] = make_msgid() try: if self.ssl: