diff --git a/CHANGELOG.md b/CHANGELOG.md index 2053ff1..7659d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +6.1.1 +----- + +- Fix aggregate report processing +- Check for the existence of a configuration file if a path is supplied + 6.1.0 ----- diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 4494a75..6c3425c 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -38,7 +38,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.1.0" +__version__ = "6.1.1" logging.basicConfig( format='%(levelname)8s:%(filename)s:%(lineno)d:' @@ -725,6 +725,8 @@ def parse_report_email(input_, nameservers=None, dns_timeout=2.0, dns_timeout=dns_timeout) result = OrderedDict([("report_type", "aggregate"), ("report", aggregate_report)]) + return result + except (TypeError, ValueError, binascii.Error): pass @@ -765,7 +767,6 @@ def parse_report_email(input_, nameservers=None, dns_timeout=2.0, 'not a valid DMARC report'.format(subject) raise InvalidDMARCReport(error) - return result def parse_report_file(input_, nameservers=None, dns_timeout=2.0, diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index 1b7ab27..14883a3 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -4,6 +4,7 @@ """A CLI for parsing DMARC reports""" from argparse import Namespace, ArgumentParser +import os from configparser import ConfigParser from glob import glob import logging @@ -182,6 +183,10 @@ def _main(): args = arg_parser.parse_args() if args.config_file: + abs_path = os.path.abspath(args.config_file) + if not os.path.exists(abs_path): + logger.error("A file does not exist at {0}".format(abs_path)) + exit(-1) opts.silent = True config = ConfigParser() config.read(args.config_file) diff --git a/parsedmarc/utils.py b/parsedmarc/utils.py index 8f040d3..ffef046 100644 --- a/parsedmarc/utils.py +++ b/parsedmarc/utils.py @@ -26,7 +26,7 @@ import geoip2.errors import requests import publicsuffix -__version__ = "6.1.0" +__version__ = "6.1.1" USER_AGENT = "Mozilla/5.0 ((0 {1})) parsedmarc/{2}".format( platform.system(), diff --git a/setup.py b/setup.py index db6a25d..696a0b2 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.1.0" +__version__ = "6.1.1" description = "A Python package and CLI for parsing aggregate and " \ "forensic DMARC reports"