mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
Fix: Add weird encodings to the list (#1146)
(cherry picked from commit cfed4061e7bf3e34c52518b905065055acb8858e) Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
parent
8fffe72910
commit
494005eaa5
@ -874,8 +874,24 @@ def get_encoding(msg: Message) -> EmailEncoding:
|
|||||||
- base64
|
- base64
|
||||||
- 7bit: default if unknown or empty
|
- 7bit: default if unknown or empty
|
||||||
"""
|
"""
|
||||||
cte = str(msg.get(headers.CONTENT_TRANSFER_ENCODING, "")).lower().strip()
|
cte = (
|
||||||
if cte in ("", "7bit", "7-bit", "8bit", "binary", "8bit;", "utf-8"):
|
str(msg.get(headers.CONTENT_TRANSFER_ENCODING, ""))
|
||||||
|
.lower()
|
||||||
|
.strip()
|
||||||
|
.strip('"')
|
||||||
|
.strip("'")
|
||||||
|
)
|
||||||
|
if cte in (
|
||||||
|
"",
|
||||||
|
"7bit",
|
||||||
|
"7-bit",
|
||||||
|
"7bits",
|
||||||
|
"8bit",
|
||||||
|
"8bits",
|
||||||
|
"binary",
|
||||||
|
"8bit;",
|
||||||
|
"utf-8",
|
||||||
|
):
|
||||||
return EmailEncoding.NO
|
return EmailEncoding.NO
|
||||||
|
|
||||||
if cte == "base64":
|
if cte == "base64":
|
||||||
|
Loading…
Reference in New Issue
Block a user