From 3163bca99be065f2c3eca3563539df17c597e2b1 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 11 Feb 2024 07:15:08 +0000 Subject: [PATCH] Read extra headers for mail from config --- update_gwr_advance_ticket_date.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/update_gwr_advance_ticket_date.py b/update_gwr_advance_ticket_date.py index 2e24bb9..2a02e3d 100755 --- a/update_gwr_advance_ticket_date.py +++ b/update_gwr_advance_ticket_date.py @@ -24,6 +24,10 @@ def send_mail(subject: str, body: str) -> None: msg["Date"] = formatdate() msg["Message-ID"] = make_msgid() + # Add extra mail headers + for header, value in config.getattr("MAIL_HEADERS", []): + msg[header] = value + msg.set_content(body) s = smtplib.SMTP(config.SMTP_HOST)