signed messages & mutt

Ken Wahl ken@kenwahl.org
Fri Jan 25 02:24:02 2002


--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Davide Cavallari on 24/01/2002 at 19:18 opined thusly:

> Sometimes I  get messages  that can't automatically  be verified  by mutt.
> Really it  doesn't recognize them  as signed at all  (I can't see  the "s"
> flag). This is a typical message body:
>=20
> [message...]
>=20
>=20
> If I taka a look at the attachment list I can see something like:
>=20
> I     1 msg.pgp                [text/plain, 7bit, us-ascii, 1,0K]
>=20
> The "good signed" messages instead are composed by two attachments:
>=20
> I     1 <no description>       [text/plain, 7bit, us-ascii, 0,7K]
> I     2 <no description>       [applica/pgp-signat, 7bit, 0,2K]
>=20
> Is this a problem with my MUA configuration or is this behaviour normal?

Normal behavior.  Mutt doesn't yet automatically recognize messages=20
that are clearsigned with Content-Type=3Dtext/plain as PGP signed.  It=20
will recognize PGP/MIME or application/pgp messages.  You can use the=20
ESC-Shift-P to pass the clearsigned message to gpg which will find
the clearsigning in the plain text.

If you are using procmail as your MDA you can add the following to your
procmailrc:

*******Begin cut here*******

: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=3Dtext; x-action=3Dencrypt"

	:0 fBw
	* ^-----BEGIN PGP SIGNED MESSAGE-----
	* ^-----BEGIN PGP SIGNATURE-----
	* ^-----END PGP SIGNATURE-----
	| formail \
		-i "Content-Type: application/pgp; format=3Dtext; x-action=3Dsign"
}

:0 fBw
* ^-----BEGIN PGP PUBLIC KEY BLOCK-----
* ^-----END PGP PUBLIC KEY BLOCK-----
| formail -i "Content-Type: application/pgp-keys; format=3Dtext;"

*****End cut here******

What the above does is:

IF these 3 headers are missing:

Content-Type: message/
Content-Type: multipart/
Content-Type: application/pgp

THEN

scan the body for the following and IF the following exists then pipe
the message to formail and add the following header:
Content-Type: application/pgp; format=3Dtext; x-action=3Dsign (or encrypt)
The f switch for formail tells formail to use the pipe as a filter and
the w switch tells formail to wait for the filter to finish and check
its exitcode. If the filter is unsuccessful then don't filter the
message.

Procmail then checks the body of the message for the=20
-----BEGIN PGP SIGNED MESSAGE-----  etc type lines and adds the
appropriate headers to the message.  The first recipe is for PGP signed
or encrypted messages and the second recipe is for PGP public keys sent
to you by mail.

I also suggest you upgrade your mutt to at least 1.2.5.1 since 1.2.5 has
a security hole which can be remotely exploited.  The development builds
are pretty stable.  The current is 1.3.27 .  There are new patches for
the current development series which also make mutt more friendly to=20
these old-style signatures, ie.. the 'Outlook-compatiblity patch'.

Happy mutt-ing
--=20
Ken Wahl    ken@kenwahl.org     http://www.kenwahl.org/
PGP/GPG Key C225AA5A: http://www.kenwahl.org/pubkey.gpg
WARNING: This machine is powered by weapons grade Linux
Weaponized Linux Kernel 2.4.9-12 Uptime: 47 days, 9:17

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: PGP KeyID: C225AA5A

iD8DBQE8ULMUpDl4isIlqloRA0AGAKCcMQts1s8gdlBO5U64KR5ByQnP6ACglxI2
MirS5k+ewYBxYgyvByUPtKE=
=p9Fr
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--