handle case to header isn't present

This commit is contained in:
Son Nguyen Kim 2021-09-08 15:49:47 +02:00
parent a58cf9dd5e
commit ff2cbeb3af
1 changed files with 5 additions and 0 deletions

View File

@ -1288,6 +1288,11 @@ def handle_hotmail_complaint(msg: Message):
"""
orig_msg = get_orig_message_from_outlook_complaint(msg)
to_header = orig_msg["To"]
if not to_header:
LOG.e("cannot find the alias")
LOG.d("msg:%s, \n orig_msg:%s", msg, orig_msg)
return
_, alias_address = parseaddr_unicode(to_header)
alias = Alias.get_by(email=alias_address)