aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÓscar Nájera <hi@oscarnajera.com>2022-10-08 02:15:18 +0200
committerÓscar Nájera <hi@oscarnajera.com>2022-10-08 03:00:36 +0200
commit533486ef8869e062717df67e81dbce9b99214204 (patch)
tree5c0c08518ed8dc4e5ed150d472d8f3543a7eeb1b
parent5301ff7d74c2df7a21540bdee28ddb712be916d6 (diff)
downloaddotfiles-533486ef8869e062717df67e81dbce9b99214204.tar.gz
dotfiles-533486ef8869e062717df67e81dbce9b99214204.tar.bz2
dotfiles-533486ef8869e062717df67e81dbce9b99214204.zip
arsmagna mailbox download
Unify dotfiles to pick from who to download mail
-rw-r--r--config/doom/config.org16
-rw-r--r--mail/dot-mbsyncrc.personal26
2 files changed, 41 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
diff --git a/mail/dot-mbsyncrc.personal b/mail/dot-mbsyncrc.personal
index 721bed3..527cd52 100644
--- a/mail/dot-mbsyncrc.personal
+++ b/mail/dot-mbsyncrc.personal
@@ -140,6 +140,32 @@ Create Both
SyncState *
Expunge Both
+###############################################################################
+# Startup
+IMAPAccount hi_arsmagna
+Host mail.oscarnajera.com
+User hi@arsmagna.xyz
+PassCmd "pass show WebSites/arsmagna.xyz/mailbox/hello"
+AuthMechs LOGIN
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore am-remote
+Account hi_arsmagna
+
+MaildirStore am-local
+Path ~/.mail/am/
+Inbox ~/.mail/am/Inbox
+SubFolders Verbatim
+
+Channel hi_arsmagna
+Far :am-remote:
+Near :am-local:
+Patterns *
+Create Both
+SyncState *
+Expunge Both
+
# Local Variables:
# mode: conf-unix
# End: