mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
Rectify email message ID, change multipart order (#3094)
This commit is contained in:
parent
95b7990f26
commit
073efd7a2f
@ -41,15 +41,15 @@ class Message:
|
|||||||
msg["From"] = f"{self.mail_from_name} <{self.mail_from_address}>"
|
msg["From"] = f"{self.mail_from_name} <{self.mail_from_address}>"
|
||||||
msg["To"] = to
|
msg["To"] = to
|
||||||
msg["Date"] = formatdate(localtime=True)
|
msg["Date"] = formatdate(localtime=True)
|
||||||
msg.add_alternative(self.html, subtype="html")
|
|
||||||
msg.add_alternative(html2text(self.html), subtype="plain")
|
msg.add_alternative(html2text(self.html), subtype="plain")
|
||||||
|
msg.add_alternative(self.html, subtype="html")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
message_id = f"{uuid4()}@{self.mail_from_address.split('@')[1]}"
|
message_id = f"<{uuid4()}@{self.mail_from_address.split('@')[1]}>"
|
||||||
except IndexError:
|
except IndexError:
|
||||||
# this should never happen with a valid email address,
|
# this should never happen with a valid email address,
|
||||||
# but we let the SMTP server handle it instead of raising it here
|
# 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["Message-ID"] = message_id
|
||||||
msg["MIME-Version"] = "1.0"
|
msg["MIME-Version"] = "1.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user