Merge lp:~mbp/launchpad/878140-dkim-nxdomain into lp:launchpad

Proposed by Martin Pool
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 14191
Proposed branch: lp:~mbp/launchpad/878140-dkim-nxdomain
Merge into: lp:launchpad
Diff against target: 16 lines (+6/-0)
1 file modified
lib/lp/services/mail/incoming.py (+6/-0)
To merge this branch: bzr merge lp:~mbp/launchpad/878140-dkim-nxdomain
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+80289@code.launchpad.net

Commit message

[r=lifeless][bug=878140] NXDOMAIN during DKIM validation shouldn't record a warning/oops

Description of the change

Failing to find the dns record public key for the purported dkim signer of an icoming mail message is very likely an input error and shouldn't generate an operational warning. (See bug 878140).

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/mail/incoming.py'
2--- lib/lp/services/mail/incoming.py 2011-09-28 09:44:03 +0000
3+++ lib/lp/services/mail/incoming.py 2011-10-25 05:17:25 +0000
4@@ -139,6 +139,12 @@
5 except dkim.DKIMException, e:
6 log.warning('DKIM error: %r' % (e,))
7 dkim_result = False
8+ except dns.resolver.NXDOMAIN, e:
9+ # This can easily happen just through bad input data, ie claiming to
10+ # be signed by a domain with no visible key of that name. It's not an
11+ # operational error.
12+ log.info('DNS exception: %r' % (e,))
13+ dkim_result = False
14 except dns.exception.DNSException, e:
15 # many of them have lame messages, thus %r
16 log.warning('DNS exception: %r' % (e,))