#1569: pgp_autosign and pgp_autoencrypt only if a key is available --------------------------+---------------------- Reporter: Nikolaus@… | Owner: mutt-dev Type: enhancement | Status: new Priority: trivial | Milestone: Component: crypto | Version: 1.5.4i Resolution: | Keywords: --------------------------+----------------------
Comment (by kevin8t8): $crypt_opportunistic_encrypt solves half of this problem now: automatically turning on/off encryption based on the recipients. A couple send2-hook combined with a send-hook "hack" can keep the sign setting in sync with the encrypt setting: {{{ set crypt_opportunistic_encrypt send-hook . 'push <edit-to><enter>' send2-hook '!~G ~g' 'push <pgp-menu>c' send2-hook '~G !~g' 'push <pgp-menu>s' }}} Unfortunately, the first time you edit the message before the menu loop, encryption settings (including opportunistic encrypt) are set *after* the send2-hook runs. So initially the sign and encrypt settings are out of sync. The "send-hook . 'push <edit-to><enter>'" is a hack to re-trigger the send2-hook once we're in the menu loop. It may be useful to add another send2-hook call to fill in that missing spot, but I'll have to talk with the other developers about that. -- Ticket URL: <http://dev.mutt.org/trac/ticket/1569#comment:7> Mutt <http://www.mutt.org/> The Mutt mail user agent