Mutt: Decrypting inline gpg format directly
Mathias Bauer
mbauer at mailbox.org
Sat Jul 19 00:17:06 CEST 2014
Hello,
* Heinz Diehl wrote on Fri, 18 Jul 2014, at 20:59 (+0200):
> On 18.07.2014, The Fuzzy Whirlpool Thunderstorm wrote:
>
> > I wonder if Mutt can be configured to decrypt inline pgp
> > messages automatically, without piping the attachment to `gpg
> > --decrypt`.
>
> You can't. Put this into your .procmailrc. It'll transform your
> inline pgp mails accordingly:
>
> :0
> * !^Content-Type: multipart/encrypted
> {
> :0 fBw
> * ^-----BEGIN PGP MESSAGE-----
> * ^-----END PGP MESSAGE-----
> | formail \
> -i "Content-Type: application/pgp; format=text;
> x-action=encrypt"
> }
>
> :0
> * !^Content-Type: multipart/
> {
> :0 fBw
> * ^-----BEGIN PGP SIGNED MESSAGE-----
> * ^-----BEGIN PGP SIGNATURE-----
> * ^-----END PGP SIGNATURE-----
> | formail \
> -i "Content-Type: application/pgp; format=text;
> x-action=sign"
> }
There are several points worth considering before using the above
procmail recipes:
a) The latest Mutt-GnuPG-PGP-HOWTO is quite old (Feb 2000) [1].
b) RFC3156, which defines PGP/MIME, originates from Aug 2001 [2].
c) The current procmail v3.22 has some issues with the B flag [3].
and most important
d) You can't catch all curiosities automatically.
Therefore I suggest using some modified/extended recipes instead:
:0
* ! ^Content-Type:[ \t]+message/
* ! ^Content-Type:[ \t]+multipart/
* ! ^Content-Type:[ \t]+application/pgp
{
:0 f w
* B ?? ^-----BEGIN PGP MESSAGE-----
* B ?? ^-----END PGP MESSAGE-----
|formail -b -f -i 'Content-Type: application/pgp; format=text; x-action=encrypt'
:0 f w
* B ?? ^-----BEGIN PGP SIGNED MESSAGE-----
* B ?? ^-----BEGIN PGP SIGNATURE-----
* B ?? ^-----END PGP SIGNATURE-----
|formail -b -f -i 'Content-Type: application/pgp; format=text; x-action=sign'
}
But as Bob already mentioned, further details should better be
discussed on mutt-users at mutt.org.
Regards,
Mathias
[1] http://tldp.org/HOWTO/Mutt-GnuPG-PGP-HOWTO-8.html
[2] http://www.ietf.org/rfc/rfc3156.txt
[3] http://pm-doc.sourceforge.net/doc/#flags_hb_at_top_of_recipe_warning
--
CAcert Assurer
Do you want to encrypt your mail? Then join CAcert and get your SSL
certificate from https://www.CAcert.org. If you have any questions,
don't hesitate to ask.
OpenPGP: ID 0x44C3983FA7629DE8 - http://www.sks-keyservers.net
Fingerprint: B100 5DC4 9686 BE64 87E9 0E22 44C3 983F A762 9DE8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: </pipermail/attachments/20140719/91facad7/attachment.sig>
More information about the Gnupg-users
mailing list