How to sign and encrypt email messages (S/MIME) with Mutt
WARNING: as implied from the above note, this document is supported when I have time, of which I have little at the moment. Unfortunately, this document has not been updated for the new Entrust CA. I will update it when I have time, which unfortunately probably won't be very soon. Patches welcome.
ca-bundle.crt
that came with OpenSSL or
Mutt, or you are content to add
CA Certificates.~/.smime
.Add the contents of smime.rc
to your .muttrc
. smime.rc
can also be found
in /usr/local/doc/mutt/samples
if you installed in default
locations.
If you want to keep your certificates in a location other than
~/.smime
, you will have to change the applicable
references.
smime_keys initThis should create
~/.smime
,
~/.smime/certificates
and ~/.smime/keys
ca-bundle.crt
to ~/.smime/
or create
an empty file named ~/.smime/ca-bundle.crt
smime_keys add_p12 file.p12
added
private key
followed by a path and a hex number ending in
.0.
.muttrc
that says
set smime_default_key="12345678.0"and change
12345678.0to the hash for your key.
$ smime_keys add_root equifax1.pem $ smime_keys add_root uwmsn.pem
You should be set to sign email.
S/MIME: Sign sign as: 12345678.0(where
12345678.0is your
default keyfrom above) on the
Compose
menu.
yto send the message, you will be prompted for the passphrase for your private key.
s
in the index before you read the
message and S
after your have read the message (assuming
that the message signature is valid.)[-- OpenSSL output follows (current time: Tue 25 Oct 2005 01:33:41 PM CDT) --] Verification successful [-- End of OpenSSL output --] [-- The following data is signed --] ... [-- End of signed data --]Where the
current timeis actually the current time, and
...is your message.
S/MIME signature successfully verified.Should appear in the status bar at the bottom of the screen.
S/MIME: Sign sign as: 12345678.0(where
12345678.0is your
default keyfrom above) on the
Compose
menu, under the regular header information.
Sto access the S/MIME Options, select
bto
both encrypt and sign. The menu should now show:
S/MIME: Sign, Encrypt sign as: 12345678.0 Encrypt with: des3
yto send the message, you will be prompted for the passphrase for your private key. It may ask you what key you want to use when encrypting, choose wisely, otherwise you can't read your top secret message.
P
(encypted) in the index before you read the message and
S
after your have read the
message (assuming that the message signature is valid.) You may be
prompted for the passphrase to your private key.[-- The following data is S/MIME encrypted --] [-- OpenSSL output follows (current time: Tue 25 Oct 2005 03:00:59 PM CDT) --] Verification successful [-- End of OpenSSL output --] [-- The following data is signed --] ... [-- End of signed data --] [-- End of S/MIME encrypted data. --]Where the
current timeis actually the current time, and
...is your message.
S/MIME signature successfully verified.Should appear in the status bar at the bottom of the screen.
In general, Ctl-K
should be bound to
extract-keys
, so you can simply extract keys.
Due to problems with the way that some email clients send signatures,
you may not be able to add some certificates automatically, with the default
installation. We have a patch, or you can follow a simple
procedure:
mutt-1.5.10/
)$ patch -p1 < smime_keys.diff patching file smime_keys.pl
--with-ssl
!)$ openssl smime -verify -in file.msg -noverify -pk7out > file.pk7
openssl pkcs7 -print_certs -in file.pk7 > file.pem
CAcertificate that you want to trust:
smime_keys add_root file.pemNote: You do not need to trust all intermediate CAs. You can simply trust the end-user certificate.
smime_keys add_cert file.pem