diff --git a/_modules/index.html b/_modules/index.html index 11e84218..f044840d 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -3,7 +3,7 @@ - Overview: module code — parsedmarc 8.13.0 documentation + Overview: module code — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index b1b05572..08360610 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -3,7 +3,7 @@ - parsedmarc — parsedmarc 8.13.0 documentation + parsedmarc — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
@@ -121,7 +121,7 @@ from parsedmarc.utils import parse_email from parsedmarc.utils import timestamp_to_human, human_timestamp_to_datetime -__version__ = "8.13.0" +__version__ = "8.14.0" logger.debug("parsedmarc v{0}".format(__version__)) @@ -185,6 +185,8 @@ """ record = record.copy() new_record = OrderedDict() + if record["row"]["source_ip"] is None: + raise ValueError("Source IP address is empty") new_record_source = get_ip_address_info( record["row"]["source_ip"], cache=IP_ADDRESS_CACHE, @@ -192,6 +194,7 @@ always_use_local_files=always_use_local_files, reverse_dns_map_path=reverse_dns_map_path, reverse_dns_map_url=reverse_dns_map_url, + reverse_dns_map=REVERSE_DNS_MAP, offline=offline, nameservers=nameservers, timeout=dns_timeout) @@ -624,16 +627,19 @@ keep_alive() logger.debug("Processed {0}/{1}".format( i, len(report["record"]))) - report_record = _parse_report_record( - report["record"][i], - ip_db_path=ip_db_path, - offline=offline, - always_use_local_files=always_use_local_files, - reverse_dns_map_path=reverse_dns_map_path, - reverse_dns_map_url=reverse_dns_map_url, - nameservers=nameservers, - dns_timeout=timeout) - records.append(report_record) + try: + report_record = _parse_report_record( + report["record"][i], + ip_db_path=ip_db_path, + offline=offline, + always_use_local_files=always_use_local_files, + reverse_dns_map_path=reverse_dns_map_path, + reverse_dns_map_url=reverse_dns_map_url, + nameservers=nameservers, + dns_timeout=timeout) + records.append(report_record) + except Exception as e: + logger.warning("Could not parse record: {0}".format(e)) else: report_record = _parse_report_record( @@ -678,18 +684,13 @@ str: The extracted text """ - def is_base64(s): - base64_regex = re.compile(r'^[A-Za-z0-9+/=]+\Z') - return bool(base64_regex.match(s)) - try: file_object = None if isinstance(input_, str): - if is_base64(input_): - try: - file_object = BytesIO(b64decode(input_)) - except binascii.Error: - pass + try: + file_object = BytesIO(b64decode(input_)) + except binascii.Error: + pass else: file_object = open(input_, "rb") elif type(input_) is bytes: @@ -991,6 +992,7 @@ always_use_local_files=always_use_local_files, reverse_dns_map_path=reverse_dns_map_path, reverse_dns_map_url=reverse_dns_map_url, + reverse_dns_map=REVERSE_DNS_MAP, offline=offline, nameservers=nameservers, timeout=dns_timeout) @@ -1503,10 +1505,15 @@ aggregate_report_msg_uids = [] forensic_report_msg_uids = [] smtp_tls_msg_uids = [] - aggregate_reports_folder = "{0}/Aggregate".format(archive_folder) - forensic_reports_folder = "{0}/Forensic".format(archive_folder) - smtp_tls_reports_folder = "{0}/SMTP-TLS".format(archive_folder) - invalid_reports_folder = "{0}/Invalid".format(archive_folder) + folder_separator = connection.get_folder_separator() + aggregate_reports_folder = "{0}{1}Aggregate".format(archive_folder, + folder_separator) + forensic_reports_folder = "{0}{1}Forensic".format(archive_folder, + folder_separator) + smtp_tls_reports_folder = "{0}{1}SMTP-TLS".format(archive_folder, + folder_separator) + invalid_reports_folder = "{0}{1}Invalid".format(archive_folder, + folder_separator) if results: aggregate_reports = results["aggregate_reports"].copy() @@ -1800,6 +1807,7 @@ aggregate_reports = results["aggregate_reports"] forensic_reports = results["forensic_reports"] smtp_tls_reports = results["smtp_tls_reports"] + output_directory = os.path.expanduser(output_directory) if os.path.exists(output_directory): if not os.path.isdir(output_directory): diff --git a/_modules/parsedmarc/elastic.html b/_modules/parsedmarc/elastic.html index 780d2ba8..2f4a30ab 100644 --- a/_modules/parsedmarc/elastic.html +++ b/_modules/parsedmarc/elastic.html @@ -3,7 +3,7 @@ - parsedmarc.elastic — parsedmarc 8.13.0 documentation + parsedmarc.elastic — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/_modules/parsedmarc/opensearch.html b/_modules/parsedmarc/opensearch.html index 6fb1bf03..c935286f 100644 --- a/_modules/parsedmarc/opensearch.html +++ b/_modules/parsedmarc/opensearch.html @@ -3,7 +3,7 @@ - parsedmarc.opensearch — parsedmarc 8.13.0 documentation + parsedmarc.opensearch — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/_modules/parsedmarc/splunk.html b/_modules/parsedmarc/splunk.html index cfffc79f..fe2e9297 100644 --- a/_modules/parsedmarc/splunk.html +++ b/_modules/parsedmarc/splunk.html @@ -3,7 +3,7 @@ - parsedmarc.splunk — parsedmarc 8.13.0 documentation + parsedmarc.splunk — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/_modules/parsedmarc/utils.html b/_modules/parsedmarc/utils.html index 401db811..4947e534 100644 --- a/_modules/parsedmarc/utils.html +++ b/_modules/parsedmarc/utils.html @@ -3,7 +3,7 @@ - parsedmarc.utils — parsedmarc 8.13.0 documentation + parsedmarc.utils — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/_static/documentation_options.js b/_static/documentation_options.js index 0f5aeccd..cf5238a8 100644 --- a/_static/documentation_options.js +++ b/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '8.13.0', + VERSION: '8.14.0', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/api.html b/api.html index be4f47fd..fcb662b4 100644 --- a/api.html +++ b/api.html @@ -4,7 +4,7 @@ - API reference — parsedmarc 8.13.0 documentation + API reference — parsedmarc 8.14.0 documentation @@ -37,7 +37,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/contributing.html b/contributing.html index 771b7dd5..d0f2132e 100644 --- a/contributing.html +++ b/contributing.html @@ -4,7 +4,7 @@ - Contributing to parsedmarc — parsedmarc 8.13.0 documentation + Contributing to parsedmarc — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/davmail.html b/davmail.html index 851b88e9..17358b74 100644 --- a/davmail.html +++ b/davmail.html @@ -4,7 +4,7 @@ - Accessing an inbox using OWA/EWS — parsedmarc 8.13.0 documentation + Accessing an inbox using OWA/EWS — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/dmarc.html b/dmarc.html index 120abe62..438d3a27 100644 --- a/dmarc.html +++ b/dmarc.html @@ -4,7 +4,7 @@ - Understanding DMARC — parsedmarc 8.13.0 documentation + Understanding DMARC — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/elasticsearch.html b/elasticsearch.html index a3c6c611..93f5d639 100644 --- a/elasticsearch.html +++ b/elasticsearch.html @@ -4,7 +4,7 @@ - Elasticsearch and Kibana — parsedmarc 8.13.0 documentation + Elasticsearch and Kibana — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/genindex.html b/genindex.html index 4c7e3bf8..a6190a11 100644 --- a/genindex.html +++ b/genindex.html @@ -3,7 +3,7 @@ - Index — parsedmarc 8.13.0 documentation + Index — parsedmarc 8.14.0 documentation @@ -35,7 +35,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/index.html b/index.html index d222a04d..20b9ad10 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - parsedmarc documentation - Open source DMARC report analyzer and visualizer — parsedmarc 8.13.0 documentation + parsedmarc documentation - Open source DMARC report analyzer and visualizer — parsedmarc 8.14.0 documentation @@ -37,7 +37,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/installation.html b/installation.html index b46d9cd4..9c3b8c26 100644 --- a/installation.html +++ b/installation.html @@ -4,7 +4,7 @@ - Installation — parsedmarc 8.13.0 documentation + Installation — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/kibana.html b/kibana.html index e4972b6a..caae4934 100644 --- a/kibana.html +++ b/kibana.html @@ -4,7 +4,7 @@ - Using the Kibana dashboards — parsedmarc 8.13.0 documentation + Using the Kibana dashboards — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/mailing-lists.html b/mailing-lists.html index 08c1a334..73020054 100644 --- a/mailing-lists.html +++ b/mailing-lists.html @@ -4,7 +4,7 @@ - What about mailing lists? — parsedmarc 8.13.0 documentation + What about mailing lists? — parsedmarc 8.14.0 documentation @@ -36,7 +36,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/objects.inv b/objects.inv index f2f14c2c..860dfe82 100644 --- a/objects.inv +++ b/objects.inv @@ -1,6 +1,6 @@ # Sphinx inventory version 2 # Project: parsedmarc -# Version: 8.13.0 +# Version: 8.14.0 # The remainder of this file is compressed using zlib. xÚ­XßoÛ ~÷_ai{M¶IÓú2E]¶U[Õ¨ÙÔG‹ÀÅfÅàN“þõ;À‰I—ªÆéKb|ß}ÜqüpC´VMófwQ+Ö Èßç¤áÓÊÖâM°LÞæ“¬9t�^É œÍÊRCI,ÜB£´u °¥ÐX®dþ¡'9�þr=»½…üª4HÃé(ðòú×â×Ïeváõ\k¥‡B@cyRX;Èt&4¶[’ °DwÓyø7€ÆjŒà)Eç diff --git a/opensearch.html b/opensearch.html index c9712101..01dec18e 100644 --- a/opensearch.html +++ b/opensearch.html @@ -4,7 +4,7 @@ - OpenSearch and Grafana — parsedmarc 8.13.0 documentation + OpenSearch and Grafana — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/output.html b/output.html index 7d7a75df..32e1f60c 100644 --- a/output.html +++ b/output.html @@ -4,7 +4,7 @@ - Sample outputs — parsedmarc 8.13.0 documentation + Sample outputs — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/py-modindex.html b/py-modindex.html index 6942826b..fc9dc6f7 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -3,7 +3,7 @@ - Python Module Index — parsedmarc 8.13.0 documentation + Python Module Index — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/search.html b/search.html index 4bbca8a7..ce1c2676 100644 --- a/search.html +++ b/search.html @@ -3,7 +3,7 @@ - Search — parsedmarc 8.13.0 documentation + Search — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/splunk.html b/splunk.html index 1cb69db9..4e7eeeb5 100644 --- a/splunk.html +++ b/splunk.html @@ -4,7 +4,7 @@ - Splunk — parsedmarc 8.13.0 documentation + Splunk — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0
diff --git a/usage.html b/usage.html index aa502e44..ce8e5ca5 100644 --- a/usage.html +++ b/usage.html @@ -4,7 +4,7 @@ - Using parsedmarc — parsedmarc 8.13.0 documentation + Using parsedmarc — parsedmarc 8.14.0 documentation @@ -38,7 +38,7 @@ parsedmarc
- 8.13.0 + 8.14.0