From 8e5ac7a41d4e5218c5e6e5ccb48d9deb458fd757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Tue, 6 Aug 2024 13:21:01 +0200 Subject: [PATCH] Lowercase contacts to prevent abuse --- email_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email_handler.py b/email_handler.py index 84301ac8..7088bea5 100644 --- a/email_handler.py +++ b/email_handler.py @@ -206,7 +206,7 @@ def get_or_create_contact(from_header: str, mail_from: str, alias: Alias) -> Con # either reuse a contact with empty email or create a new contact with empty email contact_email = "" - contact_email = sanitize_email(contact_email, not_lower=True) + contact_email = sanitize_email(contact_email) if contact_name and "\x00" in contact_name: LOG.w("issue with contact name %s", contact_name) @@ -337,7 +337,7 @@ def replace_header_when_forward(msg: Message, alias: Alias, header: str): full_addresses += address.parse_list(h) for full_address in full_addresses: - contact_email = sanitize_email(full_address.address, not_lower=True) + contact_email = sanitize_email(full_address.address) # no transformation when alias is already in the header if contact_email.lower() == alias.email: