domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
981 stars 212 forks source link

Not a valid aggregate or forensic report after fresh Install with 8.3.x #338

Closed leonardo0014 closed 1 year ago

leonardo0014 commented 2 years ago

Based on the information in ticket #287 (Files https://github.com/domainaware/parsedmarc/issues/287#issuecomment-1029983415) , I reinstalled the script on my SuSE Linux Version 15 in a virtual environment. Unfortunately this didn't help, the error keeps coming

(parsedmarc) HOSTNAME:~ # parsedmarc -c /opt/ars/parsedmarc/etc/parsedmarc.ini --debug --verbose -o output ~/ALKANTPAN.CO.ZA\!firma.org\!1581318043\!1582020439\!3238.xml.gz

    INFO:cli.py:755:Starting parsedmarc

  0%|      | 0/1 [00:00<?, ?it/s]   DEBUG:__init__.py:935:Parsing /root/ALKANTPAN.CO.ZA!firma.org!1581318043!1582020439!3238.xml.gz

  0%|      | 0/1 [00:00<?, ?it/s]   ERROR:cli.py:837:Failed to parse /root/ALKANTPAN.CO.ZA!firma.org!1581318043!1582020439!3238.xml.gz - Not a valid aggregate or forensic report

The following versions were used:

By the way, I've tested every version from 7.0.1 to the current one and got the same error. Any idea what I'm doing wrong?

leonardo0014 commented 1 year ago

Hi

Unfortunately, the latest update to 8.3.1 still didn't solve the problem. In order not to post a new ticket, I changed the title.

(parsedmarc) HOSTNAME:~ # parsedmarc -c /opt/ars/parsedmarc/etc/parsedmarc.ini /opt/ars/files/ALKANTPAN.CO.ZA.firma.org.1581318043.1582020439.3238.xml.gz --verbose --debug
    INFO:cli.py:777:Starting parsedmarc
  0%|      | 0/1 [00:00<?, ?it/s]   DEBUG:__init__.py:930:Parsing /opt/ars/files/ALKANTPAN.CO.ZA.firma.org.1581318043.1582020439.3238.xml.gz
  0%|      | 0/1 [00:02<?, ?it/s]
   ERROR:cli.py:859:Failed to parse /opt/ars/files/ALKANTPAN.CO.ZA.firma.org.1581318043.1582020439.3238.xml.gz - Not a valid aggregate or forensic report

is it possibly due to python 3.9?

leonardo0014 commented 1 year ago

Hi

I finally figured out what my mistakes were. Error 1 is in the example ini file. There at the parameter "ip_db_path". I only had the path "/usr/share/GeoIP" there, but not only the path but the mmdb file must be specified directly. From the manual:

ip_db_path - str: An optional custom path to a MMDB file from MaxMind or DBIP

This was probably changed or corrected after an update.

Now the script runs, but still doesn't output anything. Error 2 was also in the sample ini file. There at the "silent" parameter, which was not set.

From the manual:

silent - bool: Only print errors (Default: True)

In summary the solution in the .ini:

[general]
#ip_db_path = /usr/share/GeoIP/
silent = False

Suggestion to the developers: a) Renames the "ip_db_path" parameter to "ip_db_file". b) Outputs the error with the database not found on the CLI