Last active
September 11, 2017 00:59
-
-
Save tastytea/6aae62187ac1250f9e05fd361e8d29f5 to your computer and use it in GitHub Desktop.
procmail auto-encrypt
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
--MfFXiAuoTsnnDAfX |
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
This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) | |
--MfFXiAuoTsnnDAfX | |
Content-Type: application/pgp-encrypted | |
Content-Disposition: attachment | |
Content-Description: PGP/MIME version identification | |
Version: 1 | |
--MfFXiAuoTsnnDAfX | |
Content-Type: application/octet-stream; name="msg.asc" | |
Content-Description: OpenPGP encrypted message | |
Content-Disposition: inline; filename="msg.asc" | |
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
# Thanks to <https://www.j3e.de/pgp-mime-encrypt-in-procmail.html> | |
:0 H | |
# modify your filter, which mails to encrypt, here: | |
* ^Subject: encryptme | |
{ | |
MYHDRS=`formail -XContent-Type: -XContent-disposition: -XContent-transfer-encoding:` | |
# replace with your PGP key ID here: | |
RECIPIENT="1C17FF57D51F1277304905DA9C63B7474B4D9FB5" | |
:0 fh | |
| formail -I 'Content-Type: multipart/encrypted; protocol="application/pgp-encrypted";boundary="MfFXiAuoTsnnDAfX"' -I Content-transfer-encoding: -I Content-disposition: | |
:0 fb | |
| { cat ~/.gpg-mime-start ; { echo "$MYHDRS" ; echo ; cat - ; } | gpg --batch --quiet --always-trust -a -e -r ${RECIPIENT}; cat ~/.gpg-mime-end; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment