Closed msapiro closed 9 months ago
I suggest the following:
--- dmarc_lookup.py 2023-03-08 19:37:24.261341382 -0800
+++ new_dmarc_lookup.py 2023-11-20 12:05:14.118711378 -0800
@@ -37,7 +37,7 @@
def answer_to_dict(answer):
# type: (Text) -> Dict[unicode, unicode]
'''Turn the DNS DMARC answer into a dict of tag:value pairs.'''
- a = answer.strip('"').strip(' ')
+ a = answer.strip('" ')
rawTags = [t.split('=') for t in a.split(';') if t]
retval = {t[0].strip().lower(): t[1].strip().lower() for t in rawTags}
# Simpler to lowercase everything and put 'v' back. Already validated
to strip all leading and trailing quotes and spaces instead of just stripping leading and trailing quotes followed by stripping leading and trailing spaces
Fixed in 0.16.0.
authheaders.dmarc_lookup.answer_to_dict() throws IndexError: list index out of range if given a string ending with an empty quoted value. Examples of dmark records which throw this error are:
and