verify() function doesn't differentiate between invalid and not present
I wish to use dkimpy to verify the authenticity of some emails, however not all of them have a DKIM check present in the header. I want to be able to differentiate between an invalid DKIM signature and no signature present.
I've looked at the source code for the verify() function (The one on line 848 of __init__.py) and it seems the first return is only triggered when no DKIM signature is present.
I've modified this function locally for my own purposes and it works great, but I was wondering if a "dkim.present()" feature could be added to the official dkimpy module so it becomes standard. I imagine it would have similar parameters to the verify() function, but it would just return "len([(x,y) for x,y in self.headers if x.lower() == b"dkim-signature"]) == 0" instead.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- dkimpy Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Scott Kitterman
- Solved:
- Last query:
- Last reply: