diff --git a/_modules/index.html b/_modules/index.html index 35346ba..443b32c 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -8,7 +8,7 @@ - Overview: module code — parsedmarc 6.2.2 documentation + Overview: module code — parsedmarc 6.3.0 documentation @@ -58,7 +58,7 @@
- 6.2.2 + 6.3.0
diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index c2f86b0..4954024 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -8,7 +8,7 @@ - parsedmarc — parsedmarc 6.2.2 documentation + parsedmarc — parsedmarc 6.3.0 documentation @@ -58,7 +58,7 @@
- 6.2.2 + 6.3.0
@@ -185,7 +185,7 @@ from parsedmarc.utils import timestamp_to_human, human_timestamp_to_datetime from parsedmarc.utils import parse_email -__version__ = "6.2.2" +__version__ = "6.3.0" logging.basicConfig( format='%(levelname)8s:%(filename)s:%(lineno)d:' @@ -196,8 +196,8 @@ logger.debug("parsedmarc v{0}".format(__version__)) feedback_report_regex = re.compile(r"^([\w\-]+): (.+)$", re.MULTILINE) -xml_header_regex = re.compile(r"^<\?xml .*$", re.MULTILINE) -xml_schema_regex = re.compile(r"<\/?xs:schema.>", re.MULTILINE) +xml_header_regex = re.compile(r"^<\?xml .*?>", re.MULTILINE) +xml_schema_regex = re.compile(r"</??xs:schema.*>", re.MULTILINE) MAGIC_ZIP = b"\x50\x4B\x03\x04" MAGIC_GZIP = b"\x1F\x8B" @@ -378,10 +378,10 @@ try: # Replace XML header (sometimes they are invalid) - xml = xml_header_regex.sub("", xml) + xml = xml_header_regex.sub("<?xml version=\"1.0\"?>", xml) # Remove invalid schema tags - xml = xml_schema_regex.sub('<?xml version="1.0"?>', xml) + xml = xml_schema_regex.sub('', xml) report = xmltodict.parse(xml)["feedback"] report_metadata = report["report_metadata"] @@ -1822,7 +1822,8 @@ server.idle() idle_start_time = time.monotonic() for response in responses: - if response[1] == b'RECENT' and response[0] > 0: + logging.debug("Received response: {0}".format(response)) + if response[0] > 0 and response[1] == b'RECENT': server.idle_done() res = get_dmarc_reports_from_inbox(connection=server, move_supported=ms, diff --git a/_modules/parsedmarc/elastic.html b/_modules/parsedmarc/elastic.html index d076621..62e32a0 100644 --- a/_modules/parsedmarc/elastic.html +++ b/_modules/parsedmarc/elastic.html @@ -8,7 +8,7 @@ - parsedmarc.elastic — parsedmarc 6.2.2 documentation + parsedmarc.elastic — parsedmarc 6.3.0 documentation @@ -58,7 +58,7 @@
- 6.2.2 + 6.3.0
diff --git a/_modules/parsedmarc/splunk.html b/_modules/parsedmarc/splunk.html index 9847f7e..9f55f6d 100644 --- a/_modules/parsedmarc/splunk.html +++ b/_modules/parsedmarc/splunk.html @@ -8,7 +8,7 @@ - parsedmarc.splunk — parsedmarc 6.2.2 documentation + parsedmarc.splunk — parsedmarc 6.3.0 documentation @@ -58,7 +58,7 @@
- 6.2.2 + 6.3.0
diff --git a/_modules/parsedmarc/utils.html b/_modules/parsedmarc/utils.html index 82a17ba..0cf6e62 100644 --- a/_modules/parsedmarc/utils.html +++ b/_modules/parsedmarc/utils.html @@ -8,7 +8,7 @@ - parsedmarc.utils — parsedmarc 6.2.2 documentation + parsedmarc.utils — parsedmarc 6.3.0 documentation @@ -58,7 +58,7 @@
- 6.2.2 + 6.3.0
@@ -180,8 +180,10 @@ platform.release(), ) - +null_file = open(os.devnull, "w") logger = logging.getLogger("parsedmarc") +mailparser_logger = logging.getLogger("mailparser") +mailparser_logger.setLevel(logging.CRITICAL) tempdir = tempfile.mkdtemp() @@ -590,7 +592,8 @@ with open("sample.msg", "wb") as msg_file: msg_file.write(msg_bytes) try: - subprocess.check_call(["msgconvert", "sample.msg"]) + subprocess.check_call(["msgconvert", "sample.msg"], + stdout=null_file, stderr=null_file) eml_path = "sample.eml" with open(eml_path, "rb") as eml_file: rfc822 = eml_file.read() diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt index a4785ce..b7ab9ce 100644 --- a/_sources/index.rst.txt +++ b/_sources/index.rst.txt @@ -175,12 +175,14 @@ The full set of configuration options are: - ``user`` - str: The Kafka user - ``passsword`` - str: The Kafka password - ``ssl`` - bool: Use an encrypted SSL/TLS connection (Default: True) + - ``skip_certificate_verification`` - bool: Skip certificate verification (not recommended) - ``aggregate_topic`` - str: The Kafka topic for aggregate reports - ``forensic_topic`` - str: The Kafka topic for forensic reports - ``smtp`` - ``host`` - str: The SMTP hostname - ``port`` - int: The SMTP port (Default: 25) - ``ssl`` - bool: Require SSL/TLS instead of using STARTTLS + - ``skip_certificate_verification`` - bool: Skip certificate verification (not recommended) - ``user`` - str: the SMTP username - ``password`` - str: the SMTP password - ``from`` - str: The From header to use in the email diff --git a/_static/basic.css b/_static/basic.css index 0807176..53acd09 100644 --- a/_static/basic.css +++ b/_static/basic.css @@ -231,6 +231,16 @@ a.headerlink { visibility: hidden; } +a.brackets:before, +span.brackets > a:before{ + content: "["; +} + +a.brackets:after, +span.brackets > a:after { + content: "]"; +} + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -391,6 +401,16 @@ table.citation td { border-bottom: none; } +th > p:first-child, +td > p:first-child { + margin-top: 0px; +} + +th > p:last-child, +td > p:last-child { + margin-bottom: 0px; +} + /* -- figures --------------------------------------------------------------- */ div.figure { @@ -460,11 +480,57 @@ ol.upperroman { list-style: upper-roman; } +li > p:first-child { + margin-top: 0px; +} + +li > p:last-child { + margin-bottom: 0px; +} + +dl.footnote > dt, +dl.citation > dt { + float: left; +} + +dl.footnote > dd, +dl.citation > dd { + margin-bottom: 0em; +} + +dl.footnote > dd:after, +dl.citation > dd:after { + content: ""; + clear: both; +} + +dl.field-list { + display: flex; + flex-wrap: wrap; +} + +dl.field-list > dt { + flex-basis: 20%; + font-weight: bold; + word-break: break-word; +} + +dl.field-list > dt:after { + content: ":"; +} + +dl.field-list > dd { + flex-basis: 70%; + padding-left: 1em; + margin-left: 0em; + margin-bottom: 0em; +} + dl { margin-bottom: 15px; } -dd p { +dd > p:first-child { margin-top: 0px; } @@ -537,6 +603,12 @@ dl.glossary dt { font-style: oblique; } +.classifier:before { + font-style: normal; + margin: 0.5em; + content: ":"; +} + abbr, acronym { border-bottom: dotted 1px; cursor: help; diff --git a/_static/doctools.js b/_static/doctools.js index 344db17..b33f87f 100644 --- a/_static/doctools.js +++ b/_static/doctools.js @@ -87,14 +87,13 @@ jQuery.fn.highlightText = function(text, className) { node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { - var bbox = span.getBBox(); var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect.x.baseVal.value = bbox.x; + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; rect.y.baseVal.value = bbox.y; rect.width.baseVal.value = bbox.width; rect.height.baseVal.value = bbox.height; rect.setAttribute('class', className); - var parentOfText = node.parentNode.parentNode; addItems.push({ "parent": node.parentNode, "target": rect}); diff --git a/_static/documentation_options.js b/_static/documentation_options.js index f33acb3..c13e78e 100644 --- a/_static/documentation_options.js +++ b/_static/documentation_options.js @@ -1,10 +1,10 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '6.2.2', + VERSION: '6.3.0', LANGUAGE: 'None', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, + NAVIGATION_WITH_KEYS: false }; \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js index 5ff3180..4c58264 100644 --- a/_static/searchtools.js +++ b/_static/searchtools.js @@ -36,8 +36,10 @@ if (!Scorer) { // query found in title title: 15, + partialTitle: 7, // query found in terms - term: 5 + term: 5, + partialTerm: 2 }; } @@ -56,6 +58,14 @@ var Search = { _queued_query : null, _pulse_status : -1, + htmlToText : function(htmlString) { + var htmlElement = document.createElement('span'); + htmlElement.innerHTML = htmlString; + $(htmlElement).find('.headerlink').remove(); + docContent = $(htmlElement).find('[role=main]')[0]; + return docContent.textContent || docContent.innerText; + }, + init : function() { var params = $.getQueryParameters(); if (params.q) { @@ -65,16 +75,6 @@ var Search = { } }, - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, - dataType: "script", cache: true, - complete: function(jqxhr, textstatus) { - if (textstatus != "success") { - document.getElementById("searchindexloader").src = url; - } - }}); - }, - setIndex : function(index) { var q; this._index = index; @@ -120,7 +120,7 @@ var Search = { this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); - this.status = $('

').appendTo(this.out); + this.status = $('

 

').appendTo(this.out); this.output = $('