OK, that's definitely a bug. i= is optional and the milter is crapping out because it's not there. Does this help:
diff --git a/dkimpy_milter/__init__.py b/dkimpy_milter/__init__.py
index 0440967..6052b85 100644
--- a/dkimpy_milter/__init__.py
+++ b/dkimpy_milter/__init__.py
@@ -289,7 +289,11 @@ class dkimMilter(Milter.Base): self.dkim_comment = str(x)
if milterconfig.get('Syslog'): syslog.syslog("check_dkim: {0}".format(x))
- self.header_i = codecs.decode(d.signature_fields.get(b'i'), 'ascii')
+ 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')
+ except TypeError as x:
+ pass self.header_d = codecs.decode(d.signature_fields.get(b'd'), 'ascii') self.header_a = codecs.decode(d.signature_fields.get(b'a'), 'ascii')
if res:
I mostly use it for signing, so that's definitely better tested. I have tested verification with signatures from multiple implementations, so it works at least in general. Mostly I see i= included in the signature (even though it's optional).
Thanks for the feedback and being willing to work on this. Once we get things sorted, I'll be glad to cut a new release (and get updates into Debian Stable).
OK, that's definitely a bug. i= is optional and the milter is crapping out because it's not there. Does this help:
diff --git a/dkimpy_ milter/ __init_ _.py b/dkimpy_ milter/ __init_ _.py milter/ __init_ _.py milter/ __init_ _.py Milter. Base):
self. dkim_comment = str(x) get('Syslog' ):
syslog. syslog( "check_ dkim: {0}".format(x)) decode( d.signature_ fields. get(b'i' ), 'ascii') decode( d.signature_ fields. get(b'i' ), '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')
index 0440967..6052b85 100644
--- a/dkimpy_
+++ b/dkimpy_
@@ -289,7 +289,11 @@ class dkimMilter(
if milterconfig.
- self.header_i = codecs.
+ try:
+ # i= is optional and dkimpy is fine if it's not provided
+ self.header_i = codecs.
+ except TypeError as x:
+ pass
if res:
I mostly use it for signing, so that's definitely better tested. I have tested verification with signatures from multiple implementations, so it works at least in general. Mostly I see i= included in the signature (even though it's optional).
Thanks for the feedback and being willing to work on this. Once we get things sorted, I'll be glad to cut a new release (and get updates into Debian Stable).