1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 05:25:26 +02:00

Rectify email message ID, change multipart order (#3094)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend and End-to-End Tests (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions

This commit is contained in:
Joeri 2024-02-01 13:59:21 +01:00 committed by GitHub
parent 95b7990f26
commit 073efd7a2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,15 +41,15 @@ class Message:
msg["From"] = f"{self.mail_from_name} <{self.mail_from_address}>"
msg["To"] = to
msg["Date"] = formatdate(localtime=True)
msg.add_alternative(self.html, subtype="html")
msg.add_alternative(html2text(self.html), subtype="plain")
msg.add_alternative(self.html, subtype="html")
try:
message_id = f"{uuid4()}@{self.mail_from_address.split('@')[1]}"
message_id = f"<{uuid4()}@{self.mail_from_address.split('@')[1]}>"
except IndexError:
# this should never happen with a valid email address,
# but we let the SMTP server handle it instead of raising it here
message_id = f"{uuid4()}@{self.mail_from_address}"
message_id = f"<{uuid4()}@{self.mail_from_address}>"
msg["Message-ID"] = message_id
msg["MIME-Version"] = "1.0"