Skip to content
Snippets Groups Projects
Commit 6ca85fc9 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Set Message-ID in outgoing mails

parent 36f4d4d7
No related branches found
No related tags found
1 merge request!1Set Message-ID in outgoing mails
...@@ -12,6 +12,8 @@ from datetime import datetime, date, timedelta ...@@ -12,6 +12,8 @@ from datetime import datetime, date, timedelta
import requests import requests
from io import BytesIO from io import BytesIO
import ipaddress import ipaddress
from socket import getfqdn
from uuid import uuid4
import config import config
...@@ -81,6 +83,7 @@ class MailManager: ...@@ -81,6 +83,7 @@ class MailManager:
msg["From"] = self.from_addr msg["From"] = self.from_addr
msg["To"] = to_addr msg["To"] = to_addr
msg["Subject"] = subject msg["Subject"] = subject
msg["Message-ID"] = "{}@{}".format(uuid4(), getfqdn())
msg.attach(MIMEText(content, _charset="utf-8")) msg.attach(MIMEText(content, _charset="utf-8"))
if appendix is not None: if appendix is not None:
for name, file_like in appendix: for name, file_like in appendix:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment