Mail: Do not use colons in sender names

This commit is contained in:
Raphael Michel
2023-10-20 17:01:55 +02:00
parent bd41c0e78e
commit 126fe34005

View File

@@ -98,6 +98,9 @@ def clean_sender_name(sender_name: str) -> str:
# Emails with @ in their sender name are rejected by some mailservers (e.g. Microsoft) because it looks like # Emails with @ in their sender name are rejected by some mailservers (e.g. Microsoft) because it looks like
# a phishing attempt. # a phishing attempt.
sender_name = sender_name.replace("@", " ") sender_name = sender_name.replace("@", " ")
# Emails with : in their sender name are treated by Microsoft like emails with no From header at all, leading
# to a higher spam likelihood.
sender_name = sender_name.replace(":", " ")
# Emails with excessively long sender names are rejected by some mailservers # Emails with excessively long sender names are rejected by some mailservers
if len(sender_name) > 75: if len(sender_name) > 75: