I just switched from OpenDKIM to dkimpy-milter, and it's been working great until now. However, I've noticed email from Google crashes the milter and the message gets lost permanently. The only output I've gotten was from journalctl. I'll provide any help I can.
(Also, if anyone here knows how to stop the message from getting lost when the milter crashes, that'd be much appreciated!)
Sep 01 12:48:45 mymailserver.domain.tld postfix/smtpd[10680]: connect from mail-io1-xd2a.google.com[2607:f8b0:4864:20::d2a]
Sep 01 12:48:45 mymailserver.domain.tld postfix/smtpd[10680]: Anonymous TLS connection established from mail-io1-xd2a.google.com[2607:f8b0:4864:20::d2a]: TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
Sep 01 12:48:45 mymailserver.domain.tld policyd-spf[10686]: prepend Authentication-Results: mymailserver.domain.tld; spf=pass (mailfrom) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::d2a; helo=mail-io1-xd2a.google.com; <email address hidden>; receiver=<UNKNOWN>)
Sep 01 12:48:45 mymailserver.domain.tld postfix/smtpd[10680]: C290C138BBF: client=mail-io1-xd2a.google.com[2607:f8b0:4864:20::d2a]
Sep 01 12:48:45 mymailserver.domain.tld postfix/cleanup[10687]: C290C138BBF: message-id=<email address hidden>
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: check_dkim: endswith first arg must be bytes or a tuple of bytes, not str
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: TypeError: a bytes-like object is required, not 'NoneType'
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]:
The above exception was the direct cause of the following exception:
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: Traceback (most recent call last):
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: File "/usr/local/lib/python3.6/dist-packages/Milter/__init__.py", line 772, in <lambda>
milter.set_eom_callback(lambda ctx: ctx.getpriv().eom())
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: File "/usr/local/lib/python3.6/dist-packages/dkimpy_milter/__init__.py", line 196, in eom
self.check_dkim(txt)
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: File "/usr/local/lib/python3.6/dist-packages/dkimpy_milter/__init__.py", line 292, in check_dkim
self.header_i = codecs.decode(d.signature_fields.get(b'i'), 'ascii')
Sep 01 12:48:45 mymailserver.domain.tld dkimpy-milter[21461]: TypeError: decoding with 'ascii' codec failed (TypeError: a bytes-like object is required, not 'NoneType')
Sep 01 12:48:45 mymailserver.domain.tld postfix/cleanup[10687]: C290C138BBF: milter-reject: END-OF-MESSAGE from mail-io1-xd2a.google.com[2607:f8b0:4864:20::d2a]: 4.3.0 pymilter: untrapped exception in dkimpy-filter; from=<email address hidden> to=<email address hidden> proto=ESMTP helo=<mail-io1-xd2a.google.com>
In postfix you can use milter_ default_ action to control what happens if the milter fails. See postfix documentation for details.
Thanks.