Recipe 8.7 Encrypted Mail with elm

8.7.1 Problem

You want to send and receive encrypted email conveniently with the elm mailer.

8.7.2 Solution

While viewing an encrypted message, type:

| gpg --decrypt | less

to display the decrypted text page by page. To send an encrypted message, encrypt it in your text editor. [Recipe 8.1][Recipe 8.2]

8.7.3 Discussion

We take advantage of elm's pipe feature, which sends the body of a mail message to another Linux command, in this case gpg. We further pipe it to a pager (we chose less) for convenient display. For encryption, we handle it in the text editor invoked by elm to compose messages. [Recipe 8.1][Recipe 8.2]

There are alternatives. A patched version of elm, known as ELMME+ , supports GnuPG directly. (The author, Michael Elkins, went on to create mutt, [Recipe 8.6] which also supports GnuPG.)

You might also try the pair of scripts morepgp (for decrypting and reading) and mailpgp (for encrypting and sending), available at These scripts are for PGP, but modification for GnuPG should not be difficult.

8.7.4 See Also

The elm home page is Read more about the scripts morepgp and mailpgp at and

    Chapter 9. Testing and Monitoring