I have a message that produces this, but it is unwieldy and I tried to edit it down, but that produced a different issue.
Here's a traceback
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mailman/utilities/retry.py", line 44, in f_retry
return f(*args, **kwargs)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mailman/handlers/validate_authenticity.py", line 93, in authenticate
auth_result = authenticate_message(
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/authheaders/__init__.py", line 416, in authenticate_message
arc_result = check_arc(msg, None, dnsfunc=dnsfunc)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/authheaders/__init__.py", line 316, in check_arc
return ARCAuthenticationResult(result=cv.decode('ascii'), result_comment=comment)
AttributeError: 'NoneType' object has no attribute 'decode'
The relevant code is:
def check_arc(msg, logger=None, dnsfunc=None):
""" Compute the chain validation status of an inbound message.
@param msg: an RFC822 formatted message (with either \\n or \\r\\n line endings)
@param logger: An optional logger
@param dnsfunc: An optional dns lookup function (intended for testing)
"""
a = ARC(msg)
try:
if(dnsfunc):
cv, results, comment = a.verify(dnsfunc=dnsfunc)
else:
cv, results, comment = a.verify()
except DKIMException as e:
cv, results, comment = CV_Fail, [], "%s" % e
except DNSException as e:
cv, results, comment = CV_Fail, [], "%s" % e
except Exception as e:
cv, results, comment = CV_Fail, [], "%s" % e
if comment == 'success':
comment = None
return ARCAuthenticationResult(result=cv.decode('ascii'), result_comment=comment)
The problem is the verify method of the ARC instance can return cv = None per lines 1186-1188 in dkim/init.py
for result in result_data:
if result['cv'] == CV_Fail:
return None, result_data, "ARC-Seal[%d] reported failure, the chain is terminated" % result['instance']
I have a message that produces this, but it is unwieldy and I tried to edit it down, but that produced a different issue. Here's a traceback
The relevant code is:
The problem is the
verify
method of theARC
instance can return cv = None per lines 1186-1188 in dkim/init.pyand this results in the exception.