Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linsomniac/dkim_test
A test/diagnostic program for DKIM messages.
https://github.com/linsomniac/dkim_test
Last synced: 11 days ago
JSON representation
A test/diagnostic program for DKIM messages.
- Host: GitHub
- URL: https://github.com/linsomniac/dkim_test
- Owner: linsomniac
- License: cc0-1.0
- Created: 2024-01-18T09:55:57.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-18T14:52:58.000Z (10 months ago)
- Last Synced: 2024-01-19T13:13:00.968Z (10 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dkim_test - Display diagnostic information about a DKIM message
This is a python program that can take a DKIM message and verify it. While
verifying, it will display diagnostic information. In particular, if the
DKIM signature includes the "z" information, it will display any headers
that do not match the signature.## Using
You will need the "[dkimpy](https://pypi.org/project/dkimpy/)" library: `pip install dkimpy`
(NOTE: This is different from the similarly named "pydkim")Then just run `python3 dkim_test `
You can optionally include a DKIM DNS record, otherwise it will be looked up in DNS:
`python3 dkim_test --dns-record 'v=DKIM1; ' `The DNS record can be looked up using: `host -t txt ._domainkey.` but you must remove any
double-quote/space/double-quote separators within it.## Getting DKIM Header Tests
The OpenDKIM tool includes a "Diagnostics" setting, which when enabled will include a "z" tag in the
DKIM signature. This tool will use that information to display which header field is causing the
signature failure.## Example
```shell
[N] sean@seans-laptop ~/p/dkim_test (master)> ./dkim_test --dns-record 'v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA359FxfMhz6Sw0vszgKMFfk+b6xQ7Z60QRCJRLKGNvok49okHeneQUep30RhcKhBrdo5ICzBIQP3Q7a+FKDPuWQ/erCMCqTSLD/pF/eZVTFqSoF46+IXC4k55POeZlC0PwWbJfjeDrZobuqNBTsUlfk0+hJ8GIkAg0MRbVmwequgrWAFoSlDLtV2WP4vzu+V0ZnV8e4ohZGiYv9kHfWeH7KBKp9U2NLckb6iJzvz4v7D/NjcHUJrPNt8WvlUm41lEi9Y92m52kFkuTlWOySvbL/tQHD+e1YusjkcYL9TqzGZjaioPf6bqyfbP0UFOycdoiRvJBikhAR8m8PWOpmhhmwIDAQAB' test
msg
2024-01-18 02:46:15,234 - debug - DEBUG - sig: {b'v': b'1', b'a': b'rsa-sha256', b'c': b'relaxed/simple', b'd': b'stg.example.com', b's': b'2018', b't': b'1705514370', b'bh': b'IV1s4b3EH75xXFDsvkD/BI5CVv9r6J01axQeUQQBjOw=', b'h': b'From:List-Unsubscribe:List-Unsubscribe-Post:Feedback-ID:From', b'z': b'From:=20"[email protected]=20via=20SMTP=20PRO"=20|List-Unsubscribe:=2\r\n\t 0Test=201|List-Unsubscribe-Post:=20Test=202|Feedback-ID:=20Test=20\r\n\t 3', b'b': b'uauvSkatJmthXvzQCF1pA3D66+X+A5ydRxgGqlclvbOMM0CUFBBFcOOq2EywNx4iP\r\n\t iG77b+F3RYVHMGMnBIE7CRRJvEpinxbqkP+KSL8LY7FGi9xyudVjMq2oBTcJFMI/lo\r\n\t VNlXLcRyi6ryCCSLcwky2UyJMNfOomOe8RcyBZaeX8ZLkRkjCco+evAmMzug7SAVnd\r\n\t iwMSgsKGkY97m5Q1cmmDiJWrU7vrTnkGy09FG6k9k/9nWpRcBFIGjJxDGIPfHFgASa\r\n\t kb05HVIdY0rK36cLMEtQ1H2GIxG7fU6Xa/uCCwRZWnaEKGSShxPos82L/Tia8JZ8gw\r\n\t LhX2eD8bnJgtg=='}
2024-01-18 02:46:15,235 - debug - DEBUG - bh: b'IV1s4b3EH75xXFDsvkD/BI5CVv9r6J01axQeUQQBjOw='
2024-01-18 02:46:15,235 - debug - DEBUG - b'DKIM-Signature' valid: FalseVerification results: False
DKIM signature header mismatch: From
Message: "[email protected] via SMTP PRO"
DKIM: "[email protected] via SMTP PRO"
```