diff options
author | jao <jao@gnu.org> | 2022-08-25 05:40:40 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-08-25 05:40:40 +0100 |
commit | 79696dae3f99bac5f2a8fe59628fb02f5246bd66 (patch) | |
tree | 653f46afe038fec9f9e678dba96d9d6e79d8cb86 | |
parent | b9a96c85d271b99f13fa0f1ec10fb1dd38694013 (diff) | |
download | elibs-79696dae3f99bac5f2a8fe59628fb02f5246bd66.tar.gz elibs-79696dae3f99bac5f2a8fe59628fb02f5246bd66.tar.bz2 |
email: better bcc computation
-rw-r--r-- | custom/jao-custom-email.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/custom/jao-custom-email.el b/custom/jao-custom-email.el index 3148c6c..8465790 100644 --- a/custom/jao-custom-email.el +++ b/custom/jao-custom-email.el @@ -58,12 +58,15 @@ (setq message-expand-name-standard-ui t) ;;;; adjust bcc -(defvar jao-message--bcc-rx (regexp-opt '("mail.io" "gnu.org"))) +(defvar jao-message--bcc-alist + `((,(regexp-quote "mail@jao.io") . "proton@jao.io") + (,(regexp-quote "jao@gnu.org") . "hacking@jao.io"))) (defun jao-message-insert-bcc () (let ((f (or (message-fetch-field "From") ""))) - (when (or (string-blank-p f) (string-match-p jao-message--bcc-rx f)) - (insert "Bcc: proton@jao.io\n")))) + (when-let (b (seq-some (lambda (x) (when (string-match-p (car x) f) (cdr x))) + jao-message--bcc-alist)) + (insert "Bcc: " b "\n")))) (add-hook 'message-header-setup-hook #'jao-message-insert-bcc) @@ -216,8 +219,8 @@ (jao-sendmail-local) ;;; bbdb +(jao-load-path "bbdb/lisp") (use-package bbdb - :ensure t :init (setq bbdb-complete-name-allow-cycling t bbdb-completion-display-record nil bbdb-gui t @@ -259,7 +262,7 @@ (setq bbdb-file (expand-file-name "~/.emacs.d/bbdb")) (if jao-notmuch-enabled - (bbdb-initialize 'message) + (bbdb-initialize 'message 'notmuch) (bbdb-initialize 'message 'pgp 'gnus))) ;;; narrowing (defvar jao-mail-consult-buffer-history nil) |