Configuring Pine/Alpine and GPG
I use Alpine (formerly Pine) to read my email, and I am a big proponent of GPG for encryption and signing of messages. Making these programs work well together is not always easy.
There are several tools out there which attempt to solve the problem. Here I shall point you to the one that I prefer, and describe the steps I took to make it work.
General Setup
The goal is to be able to use Pine and GPG as follows:
Send a message that is encrypted, signed, or both signed and encrypted.
Receive a message that is encrypted, and successfully decrypt it.
Receive a message that is signed, and successfully verify the signature.
You need:
- gnupg
Install
Pine and Alpine are packaged in most major Linux distributions, and should be easy to install. ez-pine-gpg is shipped as a .tgz file -- you should extract it, and run the installation tool that comes with it.
Configuration
You'll have to make some changes to your ~/.pinerc file. Here's a sample of mine:
# This variable takes a list of programs that message text is piped into
# after MIME decoding, prior to display.
display-filters=_LEADING("-----BEGIN PGP")_ /home/spevack/bin/ez-pine-gpg-incoming
# This defines a program that message text is piped into before MIME
# encoding, prior to sending
sending-filters=/home/spevack/bin/ez-pine-gpg-sign _INCLUDEALLHDRS_,
/home/spevack/bin/ez-pine-gpg-encrypt _RECIPIENTS_ spevack,
/home/spevack/bin/ez-pine-gpg-sign-and-encrypt _INCLUDEALLHDRS_ _RECIPIENTS_ spevack
Make the following changes:
/home/spevack/bin should be replaced with the installation path that you specified.
In two places, the spevack after _RECIPIENTS_ should be replaced with your GPG public key's identifier. The reason you include your own GPG identifier here is so that if you send an encrypted message to "Alice", that message is also encrypted with your public key -- if you don't do this, then you will not be able to open that message in your sent-mail folder and remind yourself of what you wrote.
