diff --git a/ChangeLog b/ChangeLog index d694d42..81dd045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Version 1.1 +Version 1.1.0 - Add domain validity check for ascii domains (no specials) - Add option to specify index number of signature to verify to dkimverify (Thanks to Nick Baugh for the change) @@ -14,7 +14,9 @@ Version 1.1 #1978835) - Thanks to Adrien (spitap) for the change - Add limitations section to README to document current IDN status - Add USE_ASYNC flag to allow async to be disabled when aiodns is - installed (LP: #1954331) - see README.md for details + installed (LP: #1954331) - see README.md for details + - Add new dkim.DnsTimeoutError class to report queried domain and selector + along with timeout error from dnspython (LP: #1873449) 2019-12-31 Version 1.0.2 - dknewkey: On posix operating systems set file permissions to 600 for diff --git a/dkim/__init__.py b/dkim/__init__.py index f19b9d7..c6d07d6 100644 --- a/dkim/__init__.py +++ b/dkim/__init__.py @@ -101,6 +101,7 @@ __all__ = [ "ValidationError", "AuthresNotFoundError", "NaClNotFoundError", + "DnsTimeoutError", "USE_ASYNC", "CV_Pass", "CV_Fail", @@ -195,6 +196,9 @@ class NaClNotFoundError(DKIMException): class UnknownKeyTypeError(DKIMException): """ Key type (k tag) is not known (rsa/ed25519) """ +class DnsTimeoutError(DKIMException): + """ DNS query for public key timed out """ + def select_headers(headers, include_headers): """Select message header fields to be signed/verified. @@ -796,6 +800,10 @@ class DomainSigner(object): except binascii.Error as e: self.logger.error('KeyFormatError: {0}'.format(e)) return False + except dns.exception.Timeout as e: + self.logger.error('DnsTimeoutError: Domain: {0} Selector: {1} Error message: {2}'.format( + sig[b'd'], sig[b's'], e)) + return False return self.verify_sig_process(sig, include_headers, sig_header, dnsfunc)