From 6d15eaae89ffee0995249f8faa238f1466f76b76 Mon Sep 17 00:00:00 2001 From: Jaden Provost Maxwell-Comfort Date: Thu, 16 May 2024 18:25:55 -0700 Subject: [PATCH] Updated email config to allow for better organization in mu4e --- .emacs.d/email.org | 40 +++++++++++++++++++++++++++++----------- .mbsyncrc | 2 +- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.emacs.d/email.org b/.emacs.d/email.org index e94c0d8..cae0075 100644 --- a/.emacs.d/email.org +++ b/.emacs.d/email.org @@ -75,6 +75,9 @@ From here, I can continue onto configuring the ~mu4e~ emacs package. ;; Avoids syncing issues. (setq mu4e-change-filenames-when-moving t) + ;; Extend header view max message count. + (setq mu4e-search-results-limit 10000) + ;; Fix message citation style for gmail. (setq message-cite-style message-cite-style-gmail) (setq message-citation-line-format "On %a, %b %d, %Y at %H:%M %p %f wrote:") @@ -86,21 +89,36 @@ From here, I can continue onto configuring the ~mu4e~ emacs package. (setq mu4e-maildir "~/.mail") ;; Config mu4e folders and bookmarks - (setq mu4e-drafts-folder "/[Gmail]/Drafts" - mu4e-sent-folder "/[Gmail]/Sent Mail" - mu4e-refile-folder "/[Gmail]/All Mail" - mu4e-trash-folder "/[Gmail]/Trash") + (setq mu4e-drafts-folder "/Drafts" + mu4e-sent-folder "/Sent" + mu4e-trash-folder "/Trash" + mu4e-refile-folder + (lambda (msg) + (cond + ((mu4e-message-contact-field-matches msg :from "no-reply@piazza.com") "/UCSC") + ((mu4e-message-contact-field-matches msg :from "notifications@instructure.com") "/UCSC") + ((mu4e-message-contact-field-matches msg :from "no-reply@gradescope.com") "/UCSC") + ((mu4e-message-contact-field-matches msg :from "notification@edstem.org") "/UCSC") + ((mu4e-message-contact-field-matches msg :from "onlinebanking@ealerts.bankofamerica.com") "/Finance") + ((s-starts-with-p "[SlugSec" (mu4e-message-field msg :subject)) "/Club") + (t "/Archive")))) - (add-to-list 'mu4e-bookmarks - '(:name "Flagged messages" :query "flag:flagged" :key ?f) - t) + (setq mu4e-bookmarks + '((:name "Filtered unread messages" :query "flag:unread AND maildir:/Archive AND NOT flag:trashed" :key ?u) + (:name "All unread messages" :query "flag:unread" :key ?U) + (:name "Today's messages" :query "date:today..now" :key ?t) + (:name "Last 7 days" :query "date:7d..now" :hide-unread t :key ?w) + (:name "Flagged messages" :query "flag:flagged" :key ?f))) (setq mu4e-maildir-shortcuts '((:maildir "/Inbox" :key ?i) - (:maildir "/[Gmail]/Sent Mail" :key ?s) - (:maildir "/[Gmail]/Trash" :key ?t) - (:maildir "/[Gmail]/Drafts" :key ?d) - (:maildir "/[Gmail]/All Mail" :key ?a)))) + (:maildir "/Archive" :key ?a) + (:maildir "/Drafts" :key ?d) + (:maildir "/Sent" :key ?s) + (:maildir "/Trash" :key ?t) + (:maildir "/Finance" :key ?f) + (:maildir "/Club" :key ?c) + (:maildir "/UCSC" :key ?u)))) #+end_src Adding some configuration to correct ~mu4e~'s default values. diff --git a/.mbsyncrc b/.mbsyncrc index abe192d..31aca92 100644 --- a/.mbsyncrc +++ b/.mbsyncrc @@ -19,6 +19,6 @@ Inbox ~/.mail/Inbox Channel gmail Far :gmail-remote: Near :gmail-local: -Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash" +Patterns * ![Gmail]* Create Both SyncState *