Move email config over from doom-emacs

This commit is contained in:
Evie Litherland-Smith 2023-10-23 23:55:52 +01:00
parent ca77fb2d1e
commit 815f603128
5 changed files with 96 additions and 7 deletions

View file

@ -10,7 +10,7 @@ switch:
sudo nixos-rebuild switch --flake .
mu:
mu init --maildir ~/.mail \
mu init --maildir ~/Mail \
--my-address=e.litherlandsmith@proton.me \
--my-address=evie@xenia.me.uk \
--my-address=evie@litherlandsmith.slmail.me \

View file

@ -22,7 +22,7 @@
imapnotify.enable = true;
};
accounts.email = {
maildirBasePath = ".mail";
maildirBasePath = "Mail";
accounts = let realName = "Evie Litherland-Smith";
in {
proton = let

View file

@ -61,6 +61,10 @@
auctex
auctex-latexmk
# custom-email-packages
mu4e
mu4e-alert
# Additional packages
magit
vterm

View file

@ -20,13 +20,13 @@
;;; Configuration phase
;; Some example modules to configure Emacs. Don't blindly copy these,
;; they are here for example purposes. Find the modules which work
;; for you and add them here.
(require 'custom-email-config)
(require 'crafted-completion-config)
(require 'crafted-defaults-config)
(require 'crafted-ide-config)
(require 'crafted-org-config)
(require 'crafted-speedbar-config)
(require 'crafted-startup-config)
(require 'crafted-ui-config)
(require 'crafted-workspaces-packages)
@ -36,7 +36,9 @@
(setq user-full-name "Evie Litherland-Smith"
user-mail-address "evie@xenia.me.uk"
display-line-numbers 'relative)
display-line-numbers 'relative
fill-column 80)
(global-display-fill-column-indicator-mode)
;; Theme settings
(load-theme 'doom-tokyo-night t)
@ -45,13 +47,26 @@
(set-frame-parameter nil 'alpha-background 80)
(add-to-list 'default-frame-alist '(alpha-background . 80))
;; Profile emacs startup
;; Extra functions
(defun crafted-startup-example/display-startup-time ()
"Display the startup time after Emacs is fully initialized."
(message "Crafted Emacs loaded in %s."
(emacs-init-time)))
(add-hook 'emacs-startup-hook #'crafted-startup-example/display-startup-time)
(defun my/org-move-done-tasks-to-bottom ()
"Sort all tasks in the topmost heading by TODO state."
(interactive)
(save-excursion
(while (org-up-heading-safe))
(org-sort-entries nil ?o))
;; Reset the view of TODO items
(org-overview)
(org-show-entry)
(org-show-children))
;; Set default coding system (especially for Windows)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)

View file

@ -0,0 +1,70 @@
(setq mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync --pull-new inboxes"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
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
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?o))
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" . "󱇫 "))
(require 'mu4e)
(setq mu4e-contexts
(list
(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")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Trash")
(mu4e-refile-folder . "/iCloud/Archive"))
)
(make-mu4e-context
:name "Outlook"
: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"))
)
))
(provide 'custom-email-config)