From 79b3e87a66c6eacc4ed4ec6b933e32b789eec280 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 24 Apr 2024 23:15:37 +0100 Subject: gnus: imap mail sources --- custom/jao-custom-gnus.el | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'custom') diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index c6bb301..e359029 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -185,16 +185,25 @@ nnmail-split-methods 'nnmail-split-fancy) ;;;; nnml -(setq mail-sources - (when jao-gnus-use-nnml ;; (and jao-gnus-use-nnml (not jao-notmuch-enabled)) - (let ((fix (regexp-opt '("feeds" "local" "trash" "spam")))) - (mapcar (lambda (d) `(maildir :path ,(concat d "/"))) - (directory-files "~/var/mail/gnus/" t - (concat "[^\\.]+\\.[^\\.]+\\|" fix))))) - gnus-message-archive-group nil +(setq gnus-message-archive-group nil nnml-get-new-mail t nnml-directory message-directory) +(setq mail-sources + (let* ((pwd (auth-source-pick-first-password :host "proton-bridge")) + (mds (mapcar (lambda (f) + `(maildir :path ,(expand-file-name f "~/var/mail/"))) + '("local/" "feeds/"))) + (ims (mapcar (lambda (b) + `(imap :server "127.0.0.1" :port 1143 + :user "mail@jao.io" :password ,pwd + :stream starttls :predicate "1:*" + :fetchflag "\\Deleted \\Seen" + :mailbox ,(concat "Labels/#" b))) + '("inbox" "drivel" "hacking" "bills" + "bigml" "prog" "words")))) + (append mds ims))) + (when jao-gnus-use-nnml (add-to-list 'gnus-secondary-select-methods -- cgit v1.2.3