8.7. Encrypted Mail with elm
Problem
You want to send and receive encrypted email conveniently with the elm mailer.
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]
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 http://www.math.fu-berlin.de/~guckes/elm/scripts/elm.pgp.scripts.html. These scripts are for PGP, but modification for GnuPG should not be difficult.
See Also
The elm home page is http://www.instinct.org/elm. Read more about
the scripts morepgp and mailpgp
at http://www.math.fu-berlin.de/~guckes/elm/scripts/elm.pgp.scripts.html
and http://www.math.fu-berlin.de/~guckes/elm/elm.index.html#security.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access