Convert email config

Set mu4e to use single window, add more helpful keybinds for this setup
This commit is contained in:
Evie Litherland-Smith 2023-11-08 17:17:04 +00:00
parent 3bfad55b91
commit 453f8ebeb3
2 changed files with 190 additions and 177 deletions

View file

@ -381,92 +381,6 @@ manually with something like this:
;; Shutdown server when last managed buffer is killed
(customize-set-variable 'eglot-autoshutdown t)
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t
mail-user-agent 'mu4e-user-agent
read-mail-command 'mu4e
mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-context-policy 'pick-first
mu4e-use-fancy-chars t
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
mu4e-headers-thread-orphan-prefix '("┬>" . "┬▶")
mu4e-headers-thread-connection-prefix '("" . "")
mu4e-headers-thread-first-child-prefix '("├>" . "├▶")
mu4e-headers-thread-child-prefix '("├>" . "├▶")
mu4e-headers-thread-last-child-prefix '("└>" . "╰▶")
mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰶊 ")
mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 ")
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
mu4e-headers-fields '((:human-date . 12)
(:flags . 6)
(:from-or-to . 25)
(:subject))
mu4e-headers-actions '(("org capture message" . mu4e-org-store-and-capture)
("capture message" . mu4e-action-capture-message)
("show this thread" . mu4e-action-show-thread))
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?w)))
(when (require 'mu4e nil :noerror)
(keymap-global-set "C-c m m" #'mu4e)
(keymap-global-set "C-c m u" #'mu4e-update-index)
(keymap-global-set "C-c m c" #'mu4e-compose-new)
(when (require 'mu4e-alert nil :noerror)
(mu4e-alert-set-default-style 'libnotify)
(mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))
(setq mu4e-contexts (list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
(let ((elfeed-base-directory "~/.elfeed"))
(setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory)
elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory)
@ -833,3 +747,95 @@ Depends on having `pdf-tools'."
;; when pdf-tools is loaded, apply settings.
(with-eval-after-load 'pdf-tools
(setq-default pdf-view-display-size 'fit-width)))
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t
mail-user-agent 'mu4e-user-agent
read-mail-command 'mu4e
mu4e-split-view 'single-window
mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-context-policy 'pick-first
mu4e-use-fancy-chars t
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
mu4e-headers-thread-orphan-prefix '("┬>" . "┬▶")
mu4e-headers-thread-connection-prefix '("" . "")
mu4e-headers-thread-first-child-prefix '("├>" . "├▶")
mu4e-headers-thread-child-prefix '("├>" . "├▶")
mu4e-headers-thread-last-child-prefix '("└>" . "╰▶")
mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰶊 ")
mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 ")
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
mu4e-headers-fields '((:human-date . 12)
(:flags . 6)
(:from-or-to . 25)
(:subject))
mu4e-headers-actions '(("org capture message" . mu4e-org-store-and-capture)
("capture message" . mu4e-action-capture-message)
("show this thread" . mu4e-action-show-thread))
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?w)))
(use-package mu4e
:bind (("C-c m m" . mu4e)
("C-c m u" . mu4e-update-index)
("C-c m c" . mu4e-compose-new)
("C-c m s" . mu4e-search)
("C-c m b" . mu4e-search-bookmark)
("C-c m j" . mu4e-search-maildir))
:config (setq mu4e-contexts
(list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
(use-package mu4e-alert
:after mu4e
:config
(mu4e-alert-set-default-style 'libnotify)
(mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))

View file

@ -446,96 +446,6 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
For now I'll just copy all config into this file, to confirm that it works properly.
Will reorganise into separate sections later
** TODO Email
#+BEGIN_SRC emacs-lisp
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t
mail-user-agent 'mu4e-user-agent
read-mail-command 'mu4e
mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-context-policy 'pick-first
mu4e-use-fancy-chars t
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
mu4e-headers-thread-orphan-prefix '("┬>" . "┬▶")
mu4e-headers-thread-connection-prefix '("│ " . "│ ")
mu4e-headers-thread-first-child-prefix '("├>" . "├▶")
mu4e-headers-thread-child-prefix '("├>" . "├▶")
mu4e-headers-thread-last-child-prefix '("└>" . "╰▶")
mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰶊 ")
mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 ")
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
mu4e-headers-fields '((:human-date . 12)
(:flags . 6)
(:from-or-to . 25)
(:subject))
mu4e-headers-actions '(("org capture message" . mu4e-org-store-and-capture)
("capture message" . mu4e-action-capture-message)
("show this thread" . mu4e-action-show-thread))
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?w)))
(when (require 'mu4e nil :noerror)
(keymap-global-set "C-c m m" #'mu4e)
(keymap-global-set "C-c m u" #'mu4e-update-index)
(keymap-global-set "C-c m c" #'mu4e-compose-new)
(when (require 'mu4e-alert nil :noerror)
(mu4e-alert-set-default-style 'libnotify)
(mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))
(setq mu4e-contexts (list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
#+END_SRC
** TODO Feeds
#+BEGIN_SRC emacs-lisp
(let ((elfeed-base-directory "~/.elfeed"))
@ -926,3 +836,100 @@ Will reorganise into separate sections later
(with-eval-after-load 'pdf-tools
(setq-default pdf-view-display-size 'fit-width)))
#+END_SRC
* Email
#+BEGIN_SRC emacs-lisp
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t
mail-user-agent 'mu4e-user-agent
read-mail-command 'mu4e
mu4e-split-view 'single-window
mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-context-policy 'pick-first
mu4e-use-fancy-chars t
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
mu4e-headers-thread-orphan-prefix '("┬>" . "┬▶")
mu4e-headers-thread-connection-prefix '("│ " . "│ ")
mu4e-headers-thread-first-child-prefix '("├>" . "├▶")
mu4e-headers-thread-child-prefix '("├>" . "├▶")
mu4e-headers-thread-last-child-prefix '("└>" . "╰▶")
mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰶊 ")
mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 ")
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
mu4e-headers-fields '((:human-date . 12)
(:flags . 6)
(:from-or-to . 25)
(:subject))
mu4e-headers-actions '(("org capture message" . mu4e-org-store-and-capture)
("capture message" . mu4e-action-capture-message)
("show this thread" . mu4e-action-show-thread))
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?w)))
(use-package mu4e
:bind (("C-c m m" . mu4e)
("C-c m u" . mu4e-update-index)
("C-c m c" . mu4e-compose-new)
("C-c m s" . mu4e-search)
("C-c m b" . mu4e-search-bookmark)
("C-c m j" . mu4e-search-maildir))
:config (setq mu4e-contexts
(list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
(use-package mu4e-alert
:after mu4e
:config
(mu4e-alert-set-default-style 'libnotify)
(mu4e-alert-enable-notifications)
(mu4e-alert-enable-mode-line-display))
#+END_SRC