You are not logged in.

#1 2009-12-22 09:31:03

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Using GPG with Alpine

I don't know if this rates a wiki article, most of it's available with a web search. But I do have some original research to contribute.

To setup gpg and alpine:

Link the gpg binary with a more descriptive name so you can see what a filter will be doing:

ln -s /usr/bin/gpg ~/bin/encrypt
ln -s /usr/bin/gpg ~/bin/sign

Create the following script as ~/bin/gpg-cksig:

#!/bin/bash
gpg --decrypt 2>&1

It's a quick one-liner that combines stdout and stderr when checking a sig. Because normally this works almost too good. If you're not familiar with what's happening, it looks like the messages that you sign don't get signed. But really it's working fine, and is transparent to the user. With this script, the verification of the signature will be shown at the bottom of the message, letting you know that it was signed, and the signature's status.

Now set up the filters in alpine, press m, s, c to get into the config screen. Then press w and type display filter, then w again, which will take you to the line you need to edit, press enter and add the following all on one line, it'll save into the proper config.:

_LEADING("-----BEGIN PGP SIGNED MESSAGE")_ <USERBIN>/gpg-cksig, _LEADING("-----BEGIN PGP MESSAGE")_ /usr/bin/gpg --decrypt

IMPORTANT: replace <USERBIN> with the full path to ~/bin. Alpine needs the full path, or it won't work.

Now, right below that is the Sending Filters. These are the filters that let you either sign on encrypt an outgoing message.

<USERBIN>/encrypt --encrypt -r _RECIPIENTS_ -a, <USERBIN>/sign --clearsign

IMPORTANT: again replace <USERBIN> with the full path to ~/bin.

Now when sending an email, after pressing ^X, you'll be able to choose a filter, either "sign" or "encrypt" and be dropped to a shell to give gpg your info. Send a few mails to yourself to make sure everything works, and enjoy!

One more tip: add "hidden-encrypt-to <email>" to your gpg.conf file, so you'll always be able to read your encrypted messages.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#2 2009-12-22 16:57:34

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Using GPG with Alpine

But nobody does inline anymore, and with this you can't read multipart/encrypted nor even validate multipart/signed messages. To make it worse some clients can't even validate your own inline signed messages. Solution is Topal GnuPG integration for Alpine.

I wrote an article some time back on how to set it up Notes on Alpine and GnuPG. Good news come from the re-alpine project (continuation of Alpine), they are working on integrating it, so we will finally have native support for mutlipart e-mail!

Last edited by anrxc (2009-12-22 16:59:06)


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB