From 3ad961bfb9f158f54c5f63e36983736930385342 Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Mon, 27 Sep 2021 10:21:49 +0200 Subject: [PATCH] ignore contact name that has hex ascii code \x00 --- email_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/email_handler.py b/email_handler.py index 59e8925a..b234ce52 100644 --- a/email_handler.py +++ b/email_handler.py @@ -211,6 +211,10 @@ def get_or_create_contact(from_header: str, mail_from: str, alias: Alias) -> Con contact_email = sanitize_email(contact_email) + if contact_name and "\x00" in contact_name: + LOG.w("issue with contact name %s", contact_name) + contact_name = "" + contact = Contact.get_by(alias_id=alias.id, website_email=contact_email) if contact: if contact.name != contact_name: