Skip to content

Instantly share code, notes, and snippets.

@robbat2
Created October 9, 2017 17:42
Show Gist options
  • Save robbat2/50f8c5b51fcb7f19271545f662d9ccd5 to your computer and use it in GitHub Desktop.
Save robbat2/50f8c5b51fcb7f19271545f662d9ccd5 to your computer and use it in GitHub Desktop.
procmailrc for format conversion
# Convert old-style inline PGP messages to MIME
:0
* !^Content-Type: message/
* !^Content-Type: multipart/
* !^Content-Type: application/pgp
{
:0 fBw
* ^-----BEGIN PGP MESSAGE-----
* ^-----END PGP MESSAGE-----
| formail \
-i "Content-Type: application/pgp; format=text; x-action=encrypt"
:0 fBw
* ^-----BEGIN PGP SIGNED MESSAGE-----
* ^-----BEGIN PGP SIGNATURE-----
* ^-----END PGP SIGNATURE-----
| formail \
-i "Content-Type: application/pgp; format=text; x-action=sign"
}
# Preconverts all plain-text mail arriving in certain encoded
# MIME formats into a more compact 8-bit format which can be
# used and displayed more easily by most programs.
:0
* ^Content-Type: *text/plain
{
:0 fbw
* ^Content-Transfer-Encoding: *quoted-printable
| mimencode -u -q
:0 Afhw
| $FORMAIL -I "Content-Transfer-Encoding: 8bit"
:0 fbw
* ^Content-Transfer-Encoding: *base64
| mimencode -u -b
:0 Afhw
| $FORMAIL -I "Content-Transfer-Encoding: 8bit"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment