Fedora Account System
Red Hat Associate
Red Hat Customer
Created attachment 2161069 [details] Sanitized Python reproduction and traceback Description of problem: The authheaders DMARC checker modifies a previously valid SPF authentication result when smtp.mailfrom contains a bare domain rather than a full email address. For example: spf=pass smtp.mailfrom=optonline.net Calling check_dmarc() changes the SPF smtp.mailfrom property from 'optonline.net' to None. When the Authentication-Results header is subsequently serialized, authres raises: AttributeError: 'NoneType' object has no attribute 'quote_if_needed' This caused Mailman 3 to shunt legitimate mailing-list messages. Version-Release number of selected component: python3-authheaders-0.16.3-7.fc44.noarch python3-authres-1.2.0-28.fc44.noarch mailman3-3.3.10-3.fc44.noarch Python 3.14 Fedora 44 How reproducible: Reproduced consistently using a standalone Python script without running Mailman. Steps to Reproduce: 1. Parse an Authentication-Results header containing: spf=pass smtp.mailfrom=optonline.net 2. Call authheaders.check_dmarc() with the parsed SPF and DKIM results. 3. Observe that the SPF smtp.mailfrom property changes from 'optonline.net' to None. 4. Serialize the original AuthenticationResultsHeader object using str(ar). Actual results: SPF before: 'optonline.net' DMARC result: pass SPF after: None INVALID PROPERTY: spf smtp mailfrom Serialization fails with: AttributeError: 'NoneType' object has no attribute 'quote_if_needed' Expected results: The DMARC checker should accept an existing bare-domain SPF smtp.mailfrom value without corrupting the SPF result. Authentication-Results serialization should succeed. Suspected cause: In authheaders/__init__.py, dmarc_per_from() calls get_domain_part() on the existing SPF smtp.mailfrom value and unconditionally assigns the result back to spf_result.smtp_mailfrom. When the original value is already a bare domain, the resulting None overwrites the valid SPF property. Workaround: Setting dmarc: no under Mailman's [ARC] configuration prevents the exception. Exim continues to perform SPF, DKIM, and DMARC authentication independently. A sanitized standalone reproduction script is attached.
An upstream fix appears to address this issue: https://github.com/ValiMail/authentication-headers/pull/37 Patch: https://github.com/ValiMail/authentication-headers/compare/715f29471245ec3474b074c2d431a360431a3e7a..2298a7e3c81dec33ed5fbdddf3a8d89e0f00ffe7 The patch changes `authheaders/__init__.py` line 236 from: `if '@' in mail_from_domain:` to: `if mail_from_domain is not None and '@' in mail_from_domain:` This prevents an exception when an existing SPF result has no `smtp.mailfrom` property. The upstream tests also cover an existing SPF result with a bare-domain `smtp.mailfrom`, matching the scenario encountered with Mailman 3 on Fedora 44. Please consider backporting this fix to the Fedora 44 `python3-authheaders` package.
Building now with the patch. Thanks for the report and pointers.
FEDORA-2026-470b2b71eb (python-authheaders-0.16.3-10.fc46) has been submitted as an update to Fedora 46. https://bodhi.fedoraproject.org/updates/FEDORA-2026-470b2b71eb
FEDORA-2026-470b2b71eb (python-authheaders-0.16.3-10.fc46) has been pushed to the Fedora 46 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-4979c7fe63 (python-authheaders-0.16.3-10.fc45) has been submitted as an update to Fedora 45. https://bodhi.fedoraproject.org/updates/FEDORA-2026-4979c7fe63
FEDORA-2026-06d6e2b631 (python-authheaders-0.16.3-10.fc44) has been submitted as an update to Fedora 44. https://bodhi.fedoraproject.org/updates/FEDORA-2026-06d6e2b631