This patch set implements crypt_opportunistic_encrypt.  This option
allows mutt to automatically turn encryption on and off based on the
message recipients.

When emailing one person, a hook turning on crypt_autoencrypt works well
enough, but for multiple recipients it breaks down.  The hook will turn
on encryption if one of the recipients matches the hook, whether the
other recipients support encryption or not.

This patch allows mutt to make the decision for you.  It modifies
the various find_key methods to query whether all recipients have a
crypt-hook or have a key that can be automatically determined.

I have tested this for classic pgp and gpgme modes, but don't currently
use smime.  (The patch is much less invasive for smime, but feedback on
whether that works properly would be appreicated.)

This is my first large patch to mutt, but I think it would be useful and
many people would take advantage of it.  I welcome feedback and hope I
can improve it enough to be accepted.

-Kevin

 crypt-gpgme.c             |   42 +++--------------
 crypt-gpgme.h             |    4 +-
 crypt-mod-pgp-classic.c   |    4 +-
 crypt-mod-pgp-gpgme.c     |    4 +-
 crypt-mod-smime-classic.c |    4 +-
 crypt-mod-smime-gpgme.c   |    4 +-
 crypt-mod.h               |    3 +-
 crypt.c                   |   25 +++++++++-
 cryptglue.c               |    8 +-
 mutt_crypt.h              |    4 +-
 pgp.c                     |   31 +------------
 pgp.h                     |    2 +-
 smime.c                   |   34 +--------------
 smime.h                   |    2 +-
 crypt-gpgme.c             |   14 +++--
 crypt-gpgme.h             |    4 +-
 crypt-mod-pgp-classic.c   |    4 +-
 crypt-mod-pgp-gpgme.c     |    4 +-
 crypt-mod-smime-classic.c |    4 +-
 crypt-mod-smime-gpgme.c   |    4 +-
 crypt-mod.h               |    2 +-
 crypt.c                   |    4 +-
 cryptglue.c               |   16 ++++--
 mutt_crypt.h              |   12 +++-
 pgp.c                     |    4 +-
 pgp.h                     |    2 +-
 smime.c                   |    4 +-
 smime.h                   |    2 +-
 crypt.c                   |   20 ++++++++
 mutt_crypt.h              |    3 +
 pgp.c                     |   17 +------
 crypt-gpgme.c             |  105 ++++++++++++++++++++++++++++-----------------
 pgp.c                     |   42 ++++++++++-------
 pgp.h                     |    2 +-
 pgpkey.c                  |   24 ++++++++--
 smime.c                   |    6 +-
 crypt.c                   |   30 +++++++++++-
 mutt_crypt.h              |   10 +++-
 send.c                    |    2 +-
 compose.c                 |   17 +++++++
 init.h                    |    8 +++
 mutt.h                    |    1 +
 send.c                    |    8 +++-
 43 files changed, 307 insertions(+), 239 deletions(-)

Reply via email to