{"repo":"kmille/dkim-verify","free":true,"listed":false,"github":"https://github.com/kmille/dkim-verify","clone":"git clone https://github.com/kmille/dkim-verify.git","description":"Verifying a DKIM-Signature by hand","language":"Python","stars":129,"topics":["python","dkim","rsa","debugging"],"license":null,"category":"dev-tools","readme_excerpt":"Verifying a DKIM-Signature by hand This is a blog post you can also find here: https://debugging.works/blog/verify-dkim-signature/ tldr: We take an email and verify the DKIM-Signature step by step using python. We also take care about the signing itself (RSA). The RSA part takes more place than orignally planed. The whole source code can be found in verify-dkim.py. I recently had an issue with my DKIM signatures. I just got a 'Signature wrong' message and couldn't find out what the problem was. So I decided to take a look into. What is DKIM? If your mail server supports DKIM (Domain Keys Identified Mail), it signs the email headers and body. So you can be sure that the message was not modified. High level perspective - How does it work? 1) Alice writes an email to Bob (e.g. with Thunderbird). No magic is happening here 2) The email goes to the mail server Alice has configured in her mail client 3) The mail server does the DKIM magic: It signs the email of Alice (e.g. with RSA) and adds a DKIM-Signature header to the email 4) The mail server forwards the message to Bob's mail server 5) Bob's mail server verifies the DKIM-Signature. Therefore it needs the public key of Alice which is stored in a DNS record If you are using Thunderbird you can install DKIM Verifier to see if the DKIM signature is valid You can use DMARC to specify what a mail server should do if a DKIM signature is wrong. This is what a DKIM-Signature looks like: The values are explained in RFC6376 key=value des","default_branch":null,"files":null,"tree":[],"storefront":"/r/kmille","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kmille/dkim-verify/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}