6.3.0 release - Fix issue #69

This commit is contained in:
Sean Whalen
2019-03-29 16:37:37 -04:00
parent 84dbf4d475
commit 2119382054
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -3,6 +3,7 @@
- Fix IMAP IDLE response processing for some mail servers (#67)
- Exit with a critical error when required settings are missing (#68)
- XML parsing fixes (#69)
- Add IMAP responses to debug logging
- Add `smtp` option `skip_certificate_verification`
- Add `kafka` option `skip_certificate_verification`
+4 -4
View File
@@ -49,8 +49,8 @@ logger = logging.getLogger("parsedmarc")
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"
@@ -231,10 +231,10 @@ def parse_aggregate_report_xml(xml, nameservers=None, timeout=2.0,
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"]