Fix: check if verp return is None before unpack

This commit is contained in:
Adrià Casajús 2022-05-24 07:54:07 +02:00
parent b26d04e82c
commit 2b8f7139b8
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ class ProviderComplaintOrigin(ABC):
if not return_path:
return None
_, return_path = parse_full_address(get_header_unicode(return_path))
verp_type, email_log_id = get_verp_info_from_email(return_path)
verp_data = get_verp_info_from_email(return_path)
if not verp_data:
return None
verp_type, email_log_id = verp_data
if verp_type == VerpType.transactional:
return None
email_log = EmailLog.get_by(id=email_log_id)