Add initial draft encryption support
* src/common_indep.h (opt): Add option draft_key. * src/cryptcontroller.cpp (CryptController::resolve_keys): Handle draft and resolve to draft key. (CryptController::do_crypto): Don't sign draft encrypts. * src/mail.cpp (Mail::Mail): New state variable for drafts. (do_crypt): Handle draft encryption. (Mail::encryptSignStart_o): Disable inline pgp for drafts. (Mail::updateCryptOOM_o): Don't wipe but trick Outlook when encrypting drafts. (Mail::prepareCrypto_o): New. Factored out from send event. * src/mail.h: Update accordingly. * src/mailitem-events.cpp (BeforeAutoSave): New. Start encryption. (Write, AfterWrite): Add handling for drafts. * src/main.c (read_options): Read draftKey and draftEnc. * src/windowmessages.cpp (CRYPTO_DONE): Handle drafts.
This uses some tricks to add draft encryption in a
way that the user does not notice. E.g. when an
autosave happens.
It's still a bit fragile and needs more work but the
basics work for explict draft save and autosave.
- GnuPG-Bug-Id: T4388