- Fix verify processing so missing (optional) i= tag doesn't cause the milter

to fail
This commit is contained in:
Scott Kitterman
2019-08-09 11:28:53 -04:00
parent 7ec97a6001
commit 7c3ff1905a
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -1,4 +1,6 @@
1.1.1 UNRELEASED 1.1.1 UNRELEASED
- Fix verify processing so missing (optional) i= tag doesn't cause the milter
to fail
- Fix message extraction so that signing in the same pass through the milter - Fix message extraction so that signing in the same pass through the milter
as verifying works correctly as verifying works correctly
+4
View File
@@ -288,7 +288,11 @@ class dkimMilter(Milter.Base):
self.dkim_comment = str(x) self.dkim_comment = str(x)
if milterconfig.get('Syslog'): if milterconfig.get('Syslog'):
syslog.syslog("check_dkim: {0}".format(x)) syslog.syslog("check_dkim: {0}".format(x))
try:
# i= is optional and dkimpy is fine if it's not provided
self.header_i = codecs.decode(d.signature_fields.get(b'i'), 'ascii') self.header_i = codecs.decode(d.signature_fields.get(b'i'), 'ascii')
except TypeError as x:
pass
self.header_d = codecs.decode(d.signature_fields.get(b'd'), 'ascii') self.header_d = codecs.decode(d.signature_fields.get(b'd'), 'ascii')
self.header_a = codecs.decode(d.signature_fields.get(b'a'), 'ascii') self.header_a = codecs.decode(d.signature_fields.get(b'a'), 'ascii')
if res: if res: