msimerson / mail-dmarc

Mail::DMARC, a complete DMARC implementation in Perl
Other
33 stars 23 forks source link

Reports with delivery issues aren't removed #207

Closed freddieleeman closed 5 months ago

freddieleeman commented 1 year ago

Describe the bug I've noticed that dmarc_send_reports takes longer over time. This is caused by reports that cannot be delivered to rua endpoints due to connection issues. A setting that flushes reports older than x days could be a solution.

To Reproduce Steps to reproduce the behavior:

  1. Run dmarc_send_reports on a machine after it has been running for a few months
  2. Observe undelivered reports from months ago
  3. PROFIT!

Server (please complete the following information):

Perl (please complete the following information):

freddieleeman commented 11 months ago

The execution of the dmarc_send_reports command exceeded 30 minutes due to numerous reports that couldn't be delivered because of either NXDOMAIN issues or persistent connectivity problems. To address this, I manually modified the script to delete reports upon delivery failures by commenting out the following lines:

https://github.com/msimerson/mail-dmarc/blob/c296644c08b3bbda533bb54c6a0b9ee2b68a596d/lib/Mail/DMARC/Report/Sender.pm#L458

https://github.com/msimerson/mail-dmarc/blob/c296644c08b3bbda533bb54c6a0b9ee2b68a596d/lib/Mail/DMARC/Report/Sender.pm#L464

However, it's worth noting that a more optimal solution would be to implement a mechanism that removes reports after a configurable number of consecutive delivery failures. Regrettably, I lack the experience to create a PR that would enable this functionality.