On Tue, 03 Jan 2012 13:45:14 -0800, Jameson Graef Rollins <jroll...@finestructure.net> wrote: > Any other suggestions?
In the function that I add to `message-send-hook' I do the following: (message-goto-body) ;; If already set, don't override. (if (not (looking-at (regexp-quote "<#secure "))) ;; If we can encrypt, do so, else just sign. (if (and encrypt (dme:message-determine-encryption)) (insert "<#secure method=pgpmime mode=signencrypt>\n") (insert "<#secure method=pgpmime mode=sign>\n")))) Where `dme:message-determine-encryption' is: (defun dme:message-determine-encryption () "Return `t' if we have gpg public keys for all recipients of this message." (require 'pgg) (if (not (message-news-p)) ; No encryption for news. (catch :exit (mapc (lambda (addr) (if (not (pgg-lookup-key (downcase (mail-strip-quoted-names addr)))) (throw :exit nil))) (message-tokenize-header (concat (message-fetch-field "to") "," (message-fetch-field "cc")))) t) nil)) (I'd probably re-write that to use a cl loop now - it's very old.)
Description: PGP signature
_______________________________________________ notmuch mailing list email@example.com http://notmuchmail.org/mailman/listinfo/notmuch