DKIM verification script
$ ./verify_dkim.sh MBOX_FILE
This script will create an output directory called
the following subdirectories:
messages-organized/unsignedwill contain messages that had no DKIM signature at all.
messages-organized/signed/unverifiedwill contain messages that had DKIM signatures, but for some reason those signatures could not be verified. (This does not necessarily imply forgery; configurations can change over time, and some emails servers just don't behave particularly well.)
messages-organized/signed/verifiedwill contain messages that had DKIM signatures that were verified as authentic.
The script also will produce two other outputs:
messages-splitwill be a directory containing all of the original emails, not organized in any particular way.
messages-organized.zipwill be a zipped archive of the
messages-organizeddirectory, suitable for sending via any appropriate medium.
Other potential formats
If you have just one message to verify, follow the instructions in ProPublica's 2017 post.
If you have a directory of many individual messages, consider editing this script to skip the
git mailsplitcall in the