Silent failure if async DNS is available but async dkimpy is not used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkimpy |
Fix Released
|
Medium
|
Scott Kitterman |
Bug Description
I have an application that runs under asyncio. I noticed a number of Gmail messages failing DKIM validation, despite passing when verified manually.
The problem seems to be the default fallback to aiodns, found in the main code [1].
If neither dnspython or pydns are available [2], dkimpy will fall back to aiodns if available.
In my code I am using the standard verify(..) function, rather than the async version of dkimpy. The DNS request is successfully made, but it is not awaited in the correct manner for async code. Therefore the DNS record is not always available on the first function return (which presumably returns some async magic), and DKIM verification also fails.
Of course it would be sensible to use async functions where possible. However, I do not think that dkimpy should silently fail. The non-async verify function [3] should probably refuse to use an async function, or at minimum throw an error/exception.
1 - https:/
2 - https:/
3 - https:/
Changed in dkimpy: | |
milestone: | none → 1.1.0 |
Changed in dkimpy: | |
importance: | Undecided → Medium |
assignee: | nobody → Scott Kitterman (kitterman) |
Changed in dkimpy: | |
status: | Triaged → Fix Committed |
Changed in dkimpy: | |
status: | Fix Committed → Fix Released |
Thanks. That's not a scenario I had considered when I added asyncio support, but I agree with your assessment.