mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-07-06 00:35:09 +00:00
6.3.0 release - Fix issue #69
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user