2020-08-31 17:07:11 +02:00
|
|
|
;;; email.el --- My email settings -*- lexical-binding: t -*-
|
|
|
|
|
2019-12-23 11:55:21 +01:00
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
2020-08-31 17:07:11 +02:00
|
|
|
;; Version: 0.0.1
|
|
|
|
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
|
|
|
|
;; Package-Requires: ((emacs "24"))
|
2019-12-23 11:55:21 +01:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Attempting to configure to `notmuch' for my personal use.
|
|
|
|
|
|
|
|
;;; Code:
|
2020-02-14 16:35:55 +01:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(require 'notmuch)
|
|
|
|
(require 'list)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Configuration
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-02-16 18:16:05 +01:00
|
|
|
(setq notmuch-saved-searches
|
|
|
|
'((:name "inbox" :query "tag:inbox" :key "i")
|
2020-09-01 11:17:43 +02:00
|
|
|
(:name "direct"
|
|
|
|
:query "tag:direct and tag:unread and not tag:sent"
|
|
|
|
:key "d")
|
2020-02-16 18:16:05 +01:00
|
|
|
(:name "action" :query "tag:action" :key "a")
|
|
|
|
(:name "review" :query "tag:review" :key "r")
|
|
|
|
(:name "waiting" :query "tag:waiting" :key "w")
|
2020-02-17 17:24:11 +01:00
|
|
|
(:name "broadcast" :query "tag:/broadcast\/.+/ and tag:unread" :key "b")
|
|
|
|
(:name "systems" :query "tag:/systems\/.+/ and tag:unread" :key "s")
|
2020-02-16 18:16:05 +01:00
|
|
|
(:name "sent" :query "tag:sent" :key "t")
|
|
|
|
(:name "drafts" :query "tag:draft" :key "D")))
|
2020-02-14 16:35:55 +01:00
|
|
|
|
2020-02-14 19:01:38 +01:00
|
|
|
;; Sort results from newest-to-oldest.
|
|
|
|
(setq notmuch-search-oldest-first nil)
|
|
|
|
|
2020-02-18 12:03:20 +01:00
|
|
|
;; Discard noisy email signatures.
|
|
|
|
(setq notmuch-mua-cite-function #'message-cite-original-without-signature)
|
|
|
|
|
|
|
|
;; By default, this is just '("-inbox")
|
|
|
|
(setq notmuch-archive-tags '("-inbox" "-unread" "+archive"))
|
|
|
|
|
|
|
|
;; Show saved searches even when they're empty.
|
|
|
|
(setq notmuch-show-empty-saved-searches t)
|
|
|
|
|
|
|
|
;; Currently the sendmail executable on my system is symlinked to msmtp.
|
|
|
|
(setq send-mail-function #'sendmail-send-it)
|
|
|
|
|
|
|
|
;; I'm not sure if I need this or not. Copying it from tazjin@'s monorepo.
|
|
|
|
(setq notmuch-always-prompt-for-sender nil)
|
|
|
|
|
|
|
|
;; Add the "User-Agent" header to my emails and ensure that it includes Emacs
|
|
|
|
;; and notmuch information.
|
|
|
|
(setq notmuch-mua-user-agent-function
|
|
|
|
(lambda ()
|
|
|
|
(format "Emacs %s; notmuch.el %s" emacs-version notmuch-emacs-version)))
|
|
|
|
|
|
|
|
;; I was informed that Gmail does this server-side
|
|
|
|
(setq notmuch-fcc-dirs nil)
|
|
|
|
|
|
|
|
;; Ensure buffers are closed after sending mail.
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
|
|
|
|
|
|
|
;; Ensure sender is correctly passed to msmtp.
|
|
|
|
(setq mail-specify-envelope-from t
|
|
|
|
message-sendmail-envelope-from 'header
|
|
|
|
mail-envelope-from 'header)
|
|
|
|
|
2020-02-14 16:35:55 +01:00
|
|
|
;; Assert that no two saved searches share share a KBD
|
2020-08-31 18:05:31 +02:00
|
|
|
(prelude-assert
|
2020-09-01 11:17:43 +02:00
|
|
|
(list-xs-distinct-by? (lambda (x) (plist-get x :key)) notmuch-saved-searches))
|
2019-12-23 11:55:21 +01:00
|
|
|
|
|
|
|
(provide 'email)
|
|
|
|
;;; email.el ends here
|