aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/doom/config.org16
1 files changed, 15 insertions, 1 deletions
diff --git a/config/doom/config.org b/config/doom/config.org
index 0747c3c..3e1a422 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -365,6 +365,20 @@ this new window.
(require 'comint)
(require 'ansi-color)
+(defun on/registered-mail-accounts ()
+ "Read mbsync config to extract IMAPAccounts."
+ (let ((buffer (find-file-noselect
+ (expand-file-name
+ "~/dev/dotfiles/mail/dot-mbsyncrc.personal"))))
+ (with-current-buffer buffer
+ (goto-char (point-min))
+ (prog1 (->>
+ (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t)
+ collect (match-string 1))
+ (cons "-a")
+ (completing-read "Which mailbox"))
+ (kill-buffer buffer)))))
+
(defun on/fetch-all-email ()
"Start tagmail fetch on a subprocess."
(interactive)
@@ -375,7 +389,7 @@ this new window.
(make-process
:name "E-mail fetch"
:buffer (current-buffer)
- :command '("tagmail")
+ :command `("tagmail" ,(on/registered-mail-accounts))
:filter #'comint-output-filter)))
#+END_SRC
** Sending email