about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/email.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-18T11·03+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-02-18T11·09+0000
commit993f7c93899c7fd1c7032d28d7f3305c6805f859 (patch)
tree31107ab345e82055fc2ccc7042d537c99ddd4872 /emacs/.emacs.d/wpc/email.el
parent6f179afd4940ac7c079585785865bc0e9f0b8719 (diff)
Further configure notmuch
Until now my notmuch is usable but not almost always pleasurably so. For
example, when I reply to messages, notmuch warns that "Insert failed:"; when I
check Gmail, the reply sent... strange. After consulting with a fellow notmuch
user and Emacs disciple, tazjin@, I borrowed some of his notmuch configuration.

- notmuch is no longer warning about replies
- Replies do not include noisy email signatures
- I have an Emacs User-Agent header in my outgoing mail
- All of this and more...
Diffstat (limited to 'emacs/.emacs.d/wpc/email.el')
-rw-r--r--emacs/.emacs.d/wpc/email.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/emacs/.emacs.d/wpc/email.el b/emacs/.emacs.d/wpc/email.el
index 78ebe4e5f1..a6b9a7b5a5 100644
--- a/emacs/.emacs.d/wpc/email.el
+++ b/emacs/.emacs.d/wpc/email.el
@@ -31,6 +31,38 @@
 ;; Sort results from newest-to-oldest.
 (setq notmuch-search-oldest-first nil)
 
+;; 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)
+
 ;; Assert that no two saved searches share share a KBD
 (prelude/assert
  (list/xs-distinct-by? (lambda (x) (plist-get x :key)) notmuch-saved-searches))