diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c63eb7..33b01e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +Changelog +========= + +6.10.0 +------ + +- Ignore unknown forensic report fields when generating CSVs (Closes issue #148) +- Fix crash on IMAP timeout (PR #164 - closes issue #163) +- Use SMTP port from the config file when sending emails (PR #151) +- Add support for Elasticsearch 7.0 (PR #161 - closes issue #149) +- Remove temporary workaround for DMARC aggregate report records missing a SPF domain fields + 6.9.0 ----- diff --git a/docs/index.rst b/docs/index.rst index 1632ce5..769e44a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -155,7 +155,7 @@ The full set of configuration options are: - ``timeout`` - float: Timeout in seconds to wait for an IMAP operation to complete (Default: 30) - ``max_retries`` - int: The maximum number of retries after a timeout - ``user`` - str: The IMAP user - - ``password`` - str: The IMAP password + - ``password`` - str: The IMAP password (escape ``%`` with a second ``%``) - ``reports_folder`` - str: The IMAP folder where the incoming reports can be found (Default: INBOX) - ``archive_folder`` - str: The IMAP folder to sort processed emails into (Default: Archive) - ``watch`` - bool: Use the IMAP ``IDLE`` command to process messages as they arrive diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 6b31bc2..28bc72a 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -34,7 +34,7 @@ from parsedmarc.utils import is_outlook_msg, convert_outlook_msg from parsedmarc.utils import timestamp_to_human, human_timestamp_to_datetime from parsedmarc.utils import parse_email -__version__ = "6.9.0" +__version__ = "6.10.0" logging.basicConfig( format='%(levelname)8s:%(filename)s:%(lineno)d:' @@ -165,8 +165,6 @@ def _parse_report_record(record, offline=False, nameservers=None, if type(auth_results["spf"]) != list: auth_results["spf"] = [auth_results["spf"]] for result in auth_results["spf"]: - if "domain" not in result: - result["domain"] = None new_result = OrderedDict([("domain", result["domain"])]) if "scope" in result and result["scope"] is not None: new_result["scope"] = result["scope"] @@ -729,7 +727,10 @@ def parsed_forensic_reports_to_csv(reports): rows = parsed_forensic_reports_to_csv_rows(reports) for row in rows: - csv_writer.writerow(row) + new_row = {} + for key in new_row.keys(): + new_row[key] = row[key] + csv_writer.writerow(new_row) return csv_file.getvalue() diff --git a/samples/aggregate/zoho.com!example.com!1581753600!1581840000.xml b/samples/aggregate/zoho.com!example.com!1581753600!1581840000.xml deleted file mode 100644 index 58db164..0000000 --- a/samples/aggregate/zoho.com!example.com!1581753600!1581840000.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - zoho.com - noreply-dmarc@zoho.com - https://www.zoho.com/mail/help/adminconsole/dmarc-policy.html - e2cb5d97-dcbb-470f-b2dd-45519a2abbb3 - - 1581753600 - 1581840000 - - - - example.com - r - r -

none

- 100 - 0 -
- - - 216.71.146.18 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - - - - 216.71.143.97 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - none - helo - - - - - - 216.71.146.224 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - - - - 216.71.143.87 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - - - - 216.71.143.62 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - - - - 216.71.143.52 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - none - helo - - - - - - 216.71.148.142 - 1 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - - - - 216.71.148.247 - 2 - - none - fail - fail - - - - example.com - - - - pass - example.com - s1 - - - example.com - pass - mfrom - - - -
diff --git a/setup.py b/setup.py index cc5e260..950c6e7 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup from codecs import open from os import path -__version__ = "6.9.0" +from parsedmarc import __version__ description = "A Python package and CLI for parsing aggregate and " \ "forensic DMARC reports"