[Linux-disciples] Mutt and PGP

Adam Rosi-Kessel adam at rosi-kessel.org
Fri Oct 8 09:18:32 EDT 2004


On Thu, Oct 07, 2004 at 11:21:36PM -0400, Stephen R Laniel wrote:
> gpg --list-keys | grep -i '\<[^ ]\+@[^ ]\+\>' |perl -p -e
> 's{^.*<(.*?@.*?)>.*$}{$1}g' |sort |uniq |tr '\n' '|'

> Has anyone found a better approach than manually entering
> PGPable recipients?

echo -n send-hook \"~C \( > ~/.mutt_encrypt
gpg --list-keys | grep -i '\<[^ ]\+@[^ ]\+\>' |perl -p -e 's{^.*<(.*?@.*?)>.*$}{$1}g' |sort |uniq |tr '\n' '|' | sed "s/|*$/) \" \"set pgp_autoencrypt=yes\"\n/g" >> ~/.mutt_encrypt

Then add to .muttrc

source .mutt_encrypt

That does half the job, anyway, of encrypting if a recipient is
encrypt-able.  I suppose you could complete the task thus (add to the
bottom of the above script)

echo -n send-hook \"~C \!\( >> ~/.mutt_encrypt
gpg --list-keys | grep -i '\<[^ ]\+@[^ ]\+\>' |perl -p -e 's{^.*<(.*?@.*?)>.*$}{$1}g' |sort |uniq |tr '\n' '|' | sed "s/|*$/) \" \"set pgp_autoencrypt=no\"\n/g" >> ~/.mutt_encrypt

Actually, you might have to tweak that a little bit, because I don't
think the ~C is distributed through the grouping, i.e. you'd need to make
it

(~C add1 at ex.com|~C add2 at ex2.com)

rather than

~C (add1 at ex.com|add2 at ex2.com)

which is what the example above currently does.
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20041008/4780a4cd/attachment.pgp


More information about the Linux-disciples mailing list