[Linux-disciples] Mutt and PGP

Stephen R Laniel steve at laniels.org
Thu Oct 7 23:21:36 EDT 2004


One of the things that's irritated me about mutt for a while
is that it doesn't seem to have complicated-enough logic to
handle the following sentence:

"If any of the people in the CC list lacks PGP, then don't
encrypt."

I can tell mutt that it should encrypt messages to Joe Blow,
but what if I send a message to both Joe Blow and Joe
Sixpack, the latter of whom doesn't have PGP? Then I'll get
an irritating prompt when I send the message, asking me to
specify Joe Sixpack's key ID. I'd much prefer mutt to stop
encrypting in such a case.

I think we may have also discussed previously the fact that
mutt can't handle a statement such as

"If the recipient's email address is in the results of
`gpg --list-keys`, then encrypt; otherwise don't."

One has to manually specify the recipients whose emails will
be encrypted. That seems bad.

.muttrc is pretty flexible in, say, the values that "set
signature" can take: you can do something like

send-hook '.' set signature="sigFileGenerator.pl|"

which will use the output from that pipe as the value for
'signature'. I'm surprised one couldn't do something similar
with PGP in mutt. Even the following would be an
improvement:

gpg --list-keys | grep -i '\<[^ ]\+@[^ ]\+\>' |perl -p -e
's{^.*<(.*?@.*?)>.*$}{$1}g' |sort |uniq |tr '\n' '|'

I.e., find the email addresses in the gpg output,
concatenate them with mutt's 'or' operator, and use that as
the list to test against.

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

-- 
``I am all about the delivery of *justice* to
  parking, people. That is all.''
 -Jon Sung, 27 September 2004



More information about the Linux-disciples mailing list