diff --git a/build.sh b/build.sh index 9e8591b..b2e4f09 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,19 @@ #!/usr/bin/env bash +set -e + . venv/bin/activate -pip install -U -r requirements.txt && rstcheck --report warning README.rst && cd docs && make html && touch _build/html/.nojekyll && cp -rf _build/html/* ../../parsedmarc-docs/ && cd .. && flake8 parsedmarc && flake8 tests.py && rm -rf dist/ build/ && python3 setup.py sdist && python3 setup.py bdist_wheel + +pip install -U -r requirements.txt +rstcheck --report warning README.rst +cd docs +make html +touch _build/html/.nojekyll +mkdir -p ../../parsedmarc-docs/ +cp -rf _build/html/* ../../parsedmarc-docs/ +cd .. +flake8 parsedmarc +flake8 tests.py +rm -rf dist/ build/ +python3 setup.py sdist +python3 setup.py bdist_wheel diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 4dcb175..e7d0cc5 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -921,7 +921,8 @@ def get_dmarc_reports_from_mbox(input_, nameservers=None, dns_timeout=2.0, mbox = mailbox.mbox(input_) message_keys = mbox.keys() total_messages = len(message_keys) - logger.debug("Found {0} messages in {1}".format(total_messages, input_)) + logger.debug("Found {0} messages in {1}".format(total_messages, + input_)) for i in range(len(message_keys)): message_key = message_keys[i] logger.debug("Processing message {0} of {1}".format( @@ -929,12 +930,12 @@ def get_dmarc_reports_from_mbox(input_, nameservers=None, dns_timeout=2.0, )) msg_content = mbox.get_string(message_key) try: + sa = strip_attachment_payloads parsed_email = parse_report_email(msg_content, offline=offline, nameservers=nameservers, dns_timeout=dns_timeout, - strip_attachment_payloads=\ - strip_attachment_payloads, + strip_attachment_payloads=sa, parallel=parallel) if parsed_email["report_type"] == "aggregate": aggregate_reports.append(parsed_email["report"]) diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index e51b14a..523766e 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -548,7 +548,7 @@ def _main(): opts.offline, False) aggregate_reports += reports["aggregate_reports"] forensic_reports += reports["forensic_reports"] - + if opts.imap_host: try: if opts.imap_user is None or opts.imap_password is None: