![]() | ![]() |
|
Mutt-i, GnuPG and PGP HowtoAndrés Seco AndresSH@ctv.es and J.Horacio M.G. homega@ciberia.esv1.2, February 2000This document briefly explains how to configure Mutt-i, PGP and GnuPG in its diferents versions (2.6.x, 5.x and GnuPG), noting the common problems that can occur while sending signed or encrypted mail to be read by mail clients not PGP/MIME compliants as defined in RFC2015 and in other operating systems. It also includes an example of procmail configuration to send the public keys automatically to received e-mails asking for it, as a key servers does.
1. Introduction
2. Copyright and discharge of responsability
3. Sending mail to and receiving mail from the internet
4. Mutt configuration
5. PGP and GnuPG
6. PGP and Mutt integration
7. Interesting Macros for Mutt
8. Procmail notes and tips
9. Interchanging signed/encrypted messages with different MUAs and platforms
10. Programs and versions used
11. More information1. IntroductionThis document explains how to configure Mutt-i, PGP and GnuPG in its diferents versions (2.6.x, 5.x and GnuPG) to quickly start using a mail reader with encryption and digital signing capabilities. For this purpose, example configuration files will be included to help you starting with it. To obtain maximum performance and to use all the features of the programs that we will be using, it will be necesary to read its documentation and to reconfigure the example files. Also, some problems derived from not using RFC2015 about PGP/MIME by many mail user agents in Linux and other operating systems will be comented. An aditional procmail configuration example will be showed to enable our mail client to send a public key on request. This document has been translated from the Spanish original by Andrés Seco AndresSH@ctv.es, and revised and corrected by Jordi Mallach Pérez jordi-sd@softhome.net and J.Horacio M.G. homega@ciberia.es. It was finished in October 1999. We would like to thanks Roland Rosenfeld roland@spinnaker.de, Christophe Pernod xtof.pernod@wanadoo.fr, Denis Alan Hainsworth denis@cs.brandeis.edu and Angel Carrasco acarrasco@jet.es for their corrections and suggestions.
2. Copyright and discharge of responsabilityThis document is Information and other contents in this document are the best of our knowledge. However, we may have make errors. So you should determine if you want to follow the instructions given in this document. Nobody is responsible for any damage in your computers and any other loss derived from the use of the information contained herein. THE AUTHORS AND MAINTAINERS ARE NOT RESPONSIBLE FOR ANY DAMAGE INCURRED DUE TO ACTIONS TAKEN BASED ON INFORMATION CONTAINED IN THIS DOCUMENT. Of course, we are open to all type of suggestions and corrections on the content of this document.
3. Sending mail to and receiving mail from the internetThis document does not deal with exchanging mail messages between local
machine and other nodes (inside a local area network or over the
internet). This exchange should be carried out by messages transfer agents
(MTAs) such as In this document it is presupposed that this method of send/receive
messages outside of the local computer is already installed and working in
a correct way. If you can send a message and read your mail with the
you must have installed any type of MTA that is doing the messages transfer. In other way, you can get documentation about setting it up in the manual pages of smail:
or the MTA that you have, and fetchmail:
or in other similar document that makes reference to those programs.
4. Mutt configurationNext file is a valid example to start using Mutt in a basic way,
including paths for alias file, sent messages and postponed messages. You
can further personalize it attending to the Mutt manual indications
and Simple example of
It is necesary that the directory It is also necesary to personalize the This configuration file can end up being made very big, so it is common to
separate some of its commands in different files. For the time being, the
PGP or GnuPG configuration lines are easily detachable, and the
keyboard macros that we will personalize. To do that, it will be necesary
to add the following lines to the
and to use the To get a more extensive and complete information over the use and configuration of Mutt, and about advanced features, see the Mutt manual http://www.mutt.org.
5. PGP and GnuPGTo use anyone of the versions of PGP with Mutt-i, first it will be necesary to configure PGP properly in the way that the public keys file (public keys ring) and the private keys file (private keys ring) will exist. It is convenient to previously test PGP from the command line to assure that it signs and encrypt correctly. Remember that the PGP versions that exist for Unix are We will also clarify that PGP, as being a program developed in the US, is restricted by certain exporting laws about programs that include cryptographic code; this is the reason for the existance of an international version to almost all binary versions, and it is noted with the "i" letter (pgp - pgpi).
5.1 PGP2PGP2 generates keys with the RSA http://www.rsa.com,algorithm and it uses IDEA http://www.ascom.ch as the encryption algorithm. Both are propietary algorithms and its use is restricted by its respectives patents. To run it correctly, you must have it installed, as well as having a directory called
5.2 PGP5The keys generated by PGP5 are DSS/DH (Digital Signature Standard / Diffie-Helman). PGP5 uses CAST, Triple-DES, and IDEA as encrypt algorithms. PGP5 can work with encrypted or signed data with RSA (PGP2), and use that keys to sign or encrypt (with the keys generated with PGP2, because PGP5 can not generate that type of keys). In the other hand, PGP2 can not use the DSS/DH keys from PGP5; this creates incompatibility problems, because many users continue using PGP2 with Unix/Linux. To run PGP5 correctly, in the In the case that you have installed the both versions of PGP (PGP2
installed and configured before PGP5), we will create the configuration
file
adding the following lines at the end of the file
The files with the keys rings of the different versions can cohexist without any problem in the same directory.
5.3 GnuPGGnuPG is a program with the same functions that the previous. The difference with PGP, GnuPG do not uses algorithms with restrictive patents. PGP is free for personal uses but not comercial jobs and its development is closed. GnuPG is free to be used in any job and it is open source, as our favorite operating system (also its implementation and development is made mainly in Linux). The keys generated by GnuPG are of the type DSA/ElGamal (Digital Signature Algorithm, also known as DSS). Is totaly compatible with PGP, except with the use of restricted patents algorithms RSA and IDEA. Anyway, it is posible to implement certain compatibility with that (see GnuPG mini howto http://www.dewinter.com/gnupg_howto to get it interacting with PGP2 and PGP5).
6. PGP and Mutt integrationThe operation to carry out in the outgoing messages (sign, encrypt or
both) is chosen exactly before presing " NOTE: In the case that the pass phrase was mistyped when it was asked
for, Mutt seems to be "hung", but that's not true, it is
waiting for it to be retyped. To do this, push the Through this procedure, Mutt will use PGP/MIME to send the message, and one more file will appear in the list of files to be sent with the sign (if we only select to sign) or it will encrypt the complete message (all its MIME parts) and it will only leave two MIME parts, the first with the PGP/MIME version and the second with the encrypted message (with all its MIME parts inside) and signed (if we selected to do it). Note: By some reasons, if the receptor mail user agent can not use MIME, we may need that the sign will be included inside the message body. See section about application/pgp with PGP5 and with GnuPG. Mutt will try to verify the sign or decrypt automatically the incoming messages that use PGP/MIME. See section Procmail notes and tips, in which it is commented how to change the MIME type automatically to the incoming messages that do not set its MIME type correctly.
6.1 Optional configuration filesIn the next sections you can find modifications to the Mutt configuration file to use PGP2, PGP5, and GnuPG easily. To do that, a new configuration file that we called This can be done including the complete path (its location) of the
configuration file
in which we copy (or create) the optional configuration file
Now Mutt will accept configuration variables in This method is a good way to avoid having a very big, unsorted
configuration file, and can be used to set any other group of
configuration variables in other separate file. For example, as before, if
we use vim as the default editor in Mutt, we can tell to
next change the configuration variables that we want to be different in
vim as the Mutt editor, and finally modify
With this last line we are setting
6.2 General Configuration VariablesThere are some variables that we will use globally with the three public key encrypt programs with Mutt. These variables are boolean, and can be set (activated) or unset (deactivated). In the configuration file (
In the three next sections the configuration variables to each of the PGP versions will be explained. The fourth section will explain how to modify the variables if you use more than one PGP version. (1) as Mutt requires to type the passphrase every time you want to sign or select the receipts if you want to encrypt, it may be unconvenient to set this variable. Possibly you may want to unset this variable. This is specially true encrypting messages, as you don't have all the public keys of the message receipts. (2) depending on the number of messages that we sign or decrypt, we would like to maintain the pass phrase in cache memory more or less time. This option avoid you from type the pass phrase each time you sign a new message or decrypt an incoming message. Warning: maintaining the pass phrase in cache memory is not secure, specially in network connected systems. (3) this is only necesary with the key that we use to sign. When the key is selected from the compose menu, Mutt will calculate the algoritm.
6.3 PGP2 configuration variablesTo use PGP2 with Mutt-i you need to add the following lines to the
As you know, the
6.4 PGP5 configuration variablesTo use PGP5 with Mutt-i you need to add the following lines to the
As you know, the
6.5 GnuPG configuration variablesTo use GnuPG with Mutt-i you need to add the following lines to
the
As you know, the
6.6 Mixed configuration variablesIf you want to use more than one PGP software you need to modify some of the variables that we have commented previously. Really, it is only to remove the redundant version variables. If, for example, you want to use GnuPG as the default signing tool, all
menu commands in Mutt to use GnuPG/PGP would call to this program to
the signing, decrypting, encrypting, verifying, etc... operations
now, to use the all three programs, the
7. Interesting Macros for MuttMutt is highly configurable and its working mode can be modified in a
very flexible manner if the configuration variables inside Here you can see some macros that help you to generate signed messages avoiding the PGP/MIME standard, to send it to receipts that don't support this type of signed messages following the PGP/MIME standard, and to edit the alias file and reload it without exiting Mutt (this last macro is not related to PGP/GnuPG, it is presented only as an example to show the macro power in Mutt). It is possible to tell Mutt the key bindings you want to use with PGP/GnuPG. Even when some of this options are yet configured, we can change it or add others easily modifiying the configuration file.
7.1 Signing on the message body without using PGP/MIME with PGP5Before existing PGP/MIME, the signature in a message was included in the message body. This is a very common form of sending signed messages in many mail user agents. If we want to sign like this, we have two options, leave the MIME
type of the message or modify it as To implement this two forms of signing in Mutt, we will add the
following lines to the
and now, pressing
7.2 Signing on the message body without using PGP/MIME with GnuPGAs in the previous case, but with GnuPG. The macros are:
7.3 Modifying the alias file and reloading itWith this macro included in
7.4 More macro examplesThe next listing has been obtained from Roland Rosenfeld and it shows macros to change the default signing/encrypting software and to sign without PGP/MIME with GnuPG:
You can add more macros, and some other are yet configured as default in newer versions of Mutt. Some other options include:
To see what other options are activated, you must go to the help menu (?) from the menu where you were.
8. Procmail notes and tips8.1 Configuring Procmail to send automatically your public keysAs this is not the objetive of this Howto, we will comment that the securest way to get the public key from anybody is that he gives it to us directly by hand. As many times this is not an easy method (how long they are) the people can send the public key by electronic mail, or searching it in a key server, but none of those methods assure that the obtained key is really from whom it seems to be. If you use other communication media considered "secure" (searching the owner in the phone listing and asking him to read his key "fingerprint" to contrast with the fingerprint from the key we have obtained from the non-secure path). What we are going to see is a "tip" to put into the
What it is said in the previous paragraph is: we have a copy in ASCII of
our public key, in any directory (in this case the IMPORTANT: what you have between the brackets is an space and a tab.
8.2 Verify and decrypt automatically messages without PGP/MIMEWhen you receive a signed message that uses PGP/MIME and you open it with your preferred MUA (Mutt, isn't it?), it recognizes the message as PGP/MIME and checks the signature if you have the remitent public key. These messages are the ones that have the "S" in the first part of the message line in Mutt:
while the encrypted messages have the "P":
But if the message is signed and has the "application/pgp" MIME type, when you open it Mutt doesn't check its sign, and this sign is into the message body, as here:
To verify it, you must save it and use the command line. But, it is
possible to convert this MIME messages type with Procmail to allow
Mutt to recognize it as PGP/MIME. You only need to add this
to
As you can see, this is valid to signed messages and to encrypted messages with application/pgp.
8.3 Change MIME type for messages with keys inside without PGP/MIMEWhen you receive a public key block from a non PGP/MIME compliant
MUA, you must save the message body in your disk and then insert it into
your public key ring, but, including this lines into your
Thanks to Denis Alan for this procmail note.
9. Interchanging signed/encrypted messages with different MUAs and platformsIn the first days, the PGP sign was included inside the text to sign.
Later, it was included the The actual situation is that only a few mail user agents (MUAs) are capable to integrate PGP to use the PGP/MIME standard, and it is necesary to send messages using the old time PGP sign when you know that the recipient doesn't recognize PGP/MIME. In Linux, the available mail user agents that are PGP/MIME compliant are mutt-i and pine. In Windows, only the Eudora mail client versions 3.x and 4.x can use PGP/MIME. If you know any other mail user agent that supports it, tell us by mail, to include it here.
10. Programs and versions usedTo write this document we have used the next Mutt versions:
And the next PGP and GnuPG versions:
11. More informationThe original documentation from where this document has been obtained can be found in the man pages from "mutt", "pgp", "pgp5", "gnupg", "procmail", in the respectives directories in /usr/doc and in the world wide web sites:
The recommendations (request for comments, RFC) that are referenced in this document are:
and can be found in /usr/doc/doc-rfc and in various sites in the world wide web, like http://metalab.unc.edu and http://nic.mil. You can get information from RFCs in RFC-INFO@ISI.EDU
|
![]() |