Closed tschuettler closed 3 years ago
@tschuettler Indeed, it could be improved.
@tonioo I just stumbled upon the fix from https://github.com/modoboa/modoboa-dmarc/commit/9a4bd9268778d30a118cda8a231b41eaa02112d7. It does indeed stop sending backtraces 😄.
However, it also stops processing reports without sp attribute altogether. (Which, to my understanding, are not valid according to the RFC, but we have reports from "Yahoo", "Yahoo! Inc.", "seznam.cz a.s." and "Verizon Media" that are missing a value for that attribute. That even appears as an issue in the unit tests: https://github.com/modoboa/modoboa-dmarc/runs/6308262398?check_suite_focus=true#step:9:19 and https://github.com/modoboa/modoboa-dmarc/runs/6308262398?check_suite_focus=true#step:9:23
Perhaps we could use a fallback like dmarcian does and continue processing the report?
We received a dmarc report containing:
This is arguably a case of not following the RFC since
sp
is not allowed to be empy|null, but I would propose that the dmarc parser should not send a full traceback to the reporter.This resulted in follwing excerpt of a bounce mail:
Actually browsing through
modoboa_dmarc_report
shows quite a few cases where the value ofsp
is an empty string. Most of them by not listing asp
attribute in the xml. But actually even for this offending reporter with the same xml-contents in the report. I assume that the older modoboa-dmarc under Python 2 did handle an empty xml-attribute differently than the current one under Python 3 does.In https://github.com/modoboa/modoboa-dmarc/issues/32 there was also a case of sending the full traceback. Perhaps we could try to catch the exceptions more broadly to prevent any traceback from going back to the reporter?