Created
September 19, 2023 15:58
-
-
Save robbat2/d737c958c5bc9481e86c4d313125b2e3 to your computer and use it in GitHub Desktop.
gentoo archives mail hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FORMAIL=/usr/bin/formail | |
UUID=`/usr/bin/uuidgen` | |
# inject the salt into the mail | |
:0 fhw | |
* H ?? !^X-Archives-Salt | |
| $FORMAIL -A "X-Archives-Salt: $UUID" | |
# hash the mail headers, with the salt | |
HASH=`$FORMAIL -X Received -X Date -X Message-ID -X From -X Subject -X List-Id -X X-Archives-Salt | md5sum | awk '{print $1}'` | |
# Inject the hash back as a new header | |
:0 fhw | |
* H ?? !^X-Archives-Hash | |
| $FORMAIL -A "X-Archives-Hash: $HASH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment