mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-06 14:05:21 +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
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:
parent
95b7990f26
commit
073efd7a2f
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue