nixos/home/emacs/modules/custom-email-config.el

50 lines
2.3 KiB
EmacsLisp

(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)
(when (require 'notmuch nil :noerror)
(keymap-set global-map "C-c m m" #'notmuch)
(keymap-set global-map "C-c m c" #'notmuch-mua-new-mail)
(keymap-set global-map "C-c m s" #'notmuch-search)
(setq mail-user-agent 'notmuch-user-agent
notmuch-search-oldest-first nil
notmuch-show-logo nil
notmuch-hello-thousands-separator ","
notmuch-archive-tags '("+archive" "-inbox")
notmuch-message-headers-visible nil
notmuch-multipart/alternative-discouraged '("text/plain" "multipart/related")
notmuch-show-all-multipart/alternative-parts nil
notmuch-hello-sections '(notmuch-hello-insert-header
notmuch-hello-insert-saved-searches
notmuch-hello-insert-inbox
notmuch-hello-insert-alltags)
notmuch-fcc-dirs '((".*@xenia.me.uk" . "Proton/Sent")
(".*@proton.me" . "Proton/Sent")
(".*@litherlandsmith.slmail.me" . "Proton/Sent")
(".*@icloud.com" . "iCloud/Sent")
(".*@ukaea.uk" . "Outlook/Sent")
(".*@jet.uk" . "Outlook/Sent"))
notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i" :sort-order newest-first)
(:name "unread" :query "tag:unread AND tag:inbox" :key "u" :sort-order newest-first)
(:name "flagged" :query "tag:flagged" :key "f" :sort-order newest-first)
(:name "sent" :query "tag:sent" :key "t" :sort-order newest-first)
(:name "drafts" :query "tag:draft" :key "d" :sort-order newest-first)
(:name "all mail" :query "*" :key "a" :sort-order newest-first))
notmuch-tagging-keys '(("a" notmuch-archive-tags "Archive")
("u" notmuch-show-mark-read-tags "Mark read")
("f" ("+flagged") "Flag")
("s" ("+spam" "-inbox") "Mark as spam")
("d" ("+deleted" "-inbox" "-unread") "Delete")))
(when (require 'notmuch-indicator nil :noerror)
(setq notmuch-indicator-args '((:terms "tag:unread AND tag:inbox" :label "󰮒 "))
notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer
notmuch-refresh-all-buffers
notmuch-poll-and-refresh-this-buffer))
(notmuch-indicator-mode +1)))
(provide 'custom-email-config)