diff options
author | jao <jao@gnu.org> | 2022-06-04 03:10:56 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-06-04 03:11:37 +0100 |
commit | df950ad48cbd7998114229b5f6966e00a87d4c78 (patch) | |
tree | c2b34f7897f174b1a37e0fa4af2ddb09b3a6ee9f /email.org | |
parent | dd62a05f8f189f71c2106696972891ee2edaecb6 (diff) | |
download | elibs-df950ad48cbd7998114229b5f6966e00a87d4c78.tar.gz elibs-df950ad48cbd7998114229b5f6966e00a87d4c78.tar.bz2 |
email: sneak message-dont-reply-to-names in notmuch-mua
Diffstat (limited to 'email.org')
-rw-r--r-- | email.org | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -63,7 +63,7 @@ (setq message-expand-name-standard-ui t) #+end_src -*** To->From and Bcc +*** Adjust Bcc #+begin_src emacs-lisp (defvar jao-message--bcc-rx (regexp-opt '("mail.io" "gnu.org"))) @@ -73,7 +73,9 @@ (insert "Bcc: proton@jao.io\n")))) (add-hook 'message-header-setup-hook #'jao-message-insert-bcc) - + #+end_src +*** To->From and Bcc + #+begin_src emacs-lisp (defvar jao-message-to-from nil) (defun jao-message-adjust-from () @@ -85,7 +87,24 @@ (widen) (message-replace-header "From" from))))) - (add-hook 'message-header-setup-hook #'jao-message-adjust-from) + (when jao-notmuch-enabled + (add-hook 'message-header-setup-hook #'jao-message-adjust-from)) + #+end_src +*** Clean-up reply addresses + #+begin_src emacs-lisp + (defun jao-message--dont-reply (mail) + (unless (string-match-p message-dont-reply-to-names mail) mail)) + + (defun jao-message-strip-replies () + (dolist (header '("To" "Cc")) + (when-let ((v (message-fetch-field header))) + (let* ((v (message-tokenize-header v)) + (vs (delq nil (mapcar #'jao-message--dont-reply v))) + (v (when vs (mapconcat #'string-trim vs ", ")))) + (message-replace-header header v))))) + + (when jao-notmuch-enabled + (add-hook 'message-setup-hook #'jao-message-strip-replies)) #+end_src *** Encryption |