mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 00:46:03 +03:00
[GH-ISSUE #3846] DMARC: import_aggregated_report crashes when auth_results domain is missing (NotNullViolation on dmarc_result.domain) #1924
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1924
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jg-shinji-ueda on GitHub (Dec 25, 2025).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3846
Originally assigned to: @tonioo on GitHub.
Impacted versions
Additional:
site-packages/modoboa/dmarc/lib.pySteps to reproduce
<auth_results><dkim><domain/></dkim>...</auth_results>(domain text becomesNone).Current behavior
The import crashes with a PostgreSQL NOT NULL constraint violation:
Because the importer is commonly executed via Postfix pipe delivery, the crash can cause DMARC report emails to bounce and ingestion to stop.
Expected behavior
The importer should not crash when the
<auth_results><dkim|spf><domain>value is missing/empty. It should safely handle this case, for example by:identifiers/header_from(or the already-resolved localrecord.header_from.name), and continuing the import.Video/Screenshot link (optional)
N/A
Notes / suspected root cause
In
modoboa/dmarc/lib.py, the importer currently does:If the
<domain>element is present but empty (<domain/>) or missing,.textcan beNone, leading to a NULL insert intodmarc_result.domain(NOT NULL), and the import aborts.Proposed fix (minimal)
Use
findtext()and a fallback to avoid inserting NULL:I can provide a sanitized minimal XML/EML snippet to reproduce if needed (with domains/IPs removed).
@tonioo commented on GitHub (Jan 6, 2026):
@jg-shinji-ueda Can you please provide a snippet?
@jg-shinji-ueda commented on GitHub (Feb 17, 2026):
@tonioo
https://github.com/modoboa/modoboa/issues/3846#issuecomment-3713632010
Sorry for late reply, and thank you for implements and fix. 😄