diff --git a/app/handler/provider_complaint.py b/app/handler/provider_complaint.py index 92614809..a0711aa6 100644 --- a/app/handler/provider_complaint.py +++ b/app/handler/provider_complaint.py @@ -51,6 +51,11 @@ class ProviderComplaintOrigin(ABC): def sanitize_addresses( cls, rcpt_header: Optional[str], message: Message ) -> Optional[OriginalAddresses]: + """ + If the rcpt_header is not None, use it as the valid rcpt address, otherwise try to extract it from the To header + of the original message, since in the original message there can be more than one recipients. + There can only be one sender so that one can safely be extracted from the message headers. + """ try: if not rcpt_header: rcpt_header = message[headers.TO] diff --git a/pytest.ini b/pytest.ini index 3d362baf..c0f5472c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = +xaddopts = --cov --cov-config coverage.ini --cov-report=html:htmlcov