summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--email.org15
1 files changed, 14 insertions, 1 deletions
diff --git a/email.org b/email.org
index ce4fc8a..bbbdd60 100644
--- a/email.org
+++ b/email.org
@@ -76,7 +76,7 @@
(setq message-expand-name-standard-ui t)
#+end_src
-*** Bcc
+*** To->From and Bcc
#+begin_src emacs-lisp
(defvar jao-message--bcc-rx (regexp-opt '("mail.io" "gnu.org")))
@@ -87,6 +87,19 @@
(add-hook 'message-header-setup-hook #'jao-message-insert-bcc)
+ (defvar jao-message-to-from nil)
+
+ (defun jao-message-adjust-from ()
+ (let ((to (concat (message-fetch-field "To") (message-fetch-field "Cc"))))
+ (when-let* ((tf (seq-find (lambda (tf) (string-match-p (car tf) to))
+ jao-message-to-from))
+ (from (message-make-from "Jose A Ortega Ruiz" (cdr tf))))
+ (save-restriction
+ (widen)
+ (message-replace-header "From" from)))))
+
+ (add-hook 'message-header-setup-hook #'jao-message-adjust-from)
+
#+end_src
*** Encryption
#+begin_src emacs-lisp