Uwe Brauer writes: >>>> "Xavier" == Xavier Maillard writes: > > > Hello, > > what is the correct way to tell gnus/message to 'maybe' encrypt an outgoing > > message ? > > > I previously set it via `message-setup-hook' by adding > > `mml-secure-message-encrypt'. For a reason I do not understand, it encrypted > > *ALL* outgoing messages (even on mailing-lists). That's lame since for some, I > > remember having been asked to ignore encryption for recipient I did not have a > > public key... > > > How do you practice PGP encryption/signing in Gnus ? > > There are three possiblities. [ ... cut ... ] > - You can use have an entry in your bbdb. > For example > encrypt: smime > or > encrypt: gpg > than gnus encrypt using smime or gpg > > Or nothing gnus does not do anything. I remember that possibility now ! If I could sync my carddav with bbdb, maybe I could get back to using it. > - However if I also want to sign my message than this approach is > too restrictive. So I have a yes-o-no function in my > message-send-hook namely my-hook-encrypt-or-sign-smime > > (defun my-hook-encrypt-or-sign-smime () > (interactive) > (call-interactively 'my-select-encrypt-or-sign-smime)) > > (defun my-leave-the-TAG () > (interactive) > (message "Left the TAG intact, since it is a pgp/(mime) message.")) > > (defun my-select-encrypt-or-sign-smime (ch) > (interactive "c1: encrypt, 2: encryt+sign, 3: sign 4: NO TAG 5: leave it: pgp/mime") > (setq ch (downcase ch)) > (call-interactively (cond ((eql ch ?1) #'my-only-encrypt-smime) > ((eql ch ?2) #'my-encrypt-and-sign-smime) > ((eql ch ?3) #'mml-secure-message-sign-smime) > ((eql ch ?4) #'my-mml-eliminate-smime-pgp-tag) > ((eql ch ?5) #'my-leave-the-TAG) > (t (error 'args-out-of-range '(1 2 3 4 5 ch)))))) > > You could do something similar for gpg instead of smime. Isn't this too cumbersome ? For each of your outgoing message, you have to make a choice, right ? Thanks, -- Xavier.