From 0e2856b664100627bb39e5cd18cc7f74f82ed1d2 Mon Sep 17 00:00:00 2001
From: Case Duckworth
Date: Sat, 28 Nov 2020 11:27:10 -0600
Subject: Add mu4e

---
 config.org | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/config.org b/config.org
index 6347eaf..a77aaf1 100644
--- a/config.org
+++ b/config.org
@@ -1186,6 +1186,82 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el
     (0x0-default-service 'ttm))
 #+END_SRC
 
+** Mu4e
+
+#+begin_src emacs-lisp
+  (when (executable-find "mu")
+    (add-to-list 'load-path
+                 "/usr/share/emacs/site-lisp/mu4e")
+    (require 'mu4e)
+
+    (cuss mail-user-agent 'mu4e-user-agent)
+
+    (cuss mu4e-headers-skip-duplicates t)
+    (cuss mu4e-view-show-images t)
+    (cuss mu4e-view-show-addresses t)
+    (cuss mu4e-compose-format-flowed t)
+    (cuss mu4e-change-filenames-when-moving t)
+    (cuss mu4e-attachments-dir "~/Downloads")
+
+    (cuss mu4e-maildir "~/.mail/fastmail")
+    (cuss mu4e-refile-folder "/Archive")
+    (cuss mu4e-sent-folder "/Sent")
+    (cuss mu4e-drafts-folder "/Drafts")
+    (cuss mu4e-trash-folder "/Trash")
+
+    (fset 'my-move-to-trash "mTrash")
+    (define-key mu4e-headers-mode-map (kbd "d") 'my-move-to-trash)
+    (define-key mu4e-view-mode-map (kbd "d") 'my-move-to-trash)
+
+    (cuss message-send-mail-function 'smtpmail-send-it)
+    (cuss smtpmail-default-smtp-server "smtp.fastmail.com")
+    (cuss smtpmail-smtp-server "smtp.fastmail.com")
+    (cuss smtpmail-stream-type 'ssl)
+    (cuss smtpmail-smtp-service 465)
+    (cuss smtpmail-local-domain "acdw.net")
+    (cuss mu4e-compose-signature
+          "Best,\nCase\n")
+
+    (cuss mu4e-get-mail-command "mbsync -a")
+    (cuss mu4e-update-interval 300)
+
+    (cuss mu4e-completing-read-function 'completing-read)
+    (cuss message-kill-buffer-on-exit t)
+    (cuss mu4e-confirm-quit nil)
+
+    (cuss mu4e-bookmarks
+          '((
+             :name "Unread"
+             :query
+             "flag:unread AND NOT flag:trashed AND NOT maildir:/Spam"
+             :key ?u)
+            (
+             :name "Today"
+             :query "date:today..now and not maildir:/Spam"
+             :key ?t)
+            (
+             :name "This week"
+             :query "date:7d..now and not maildir:/Spam"
+             :hide-unread t
+             :key ?w)))
+
+    (cuss mu4e-headers-fields
+          '((:human-date . 12)
+            (:flags . 6)
+            (:mailing-list . 10)
+            (:from-or-to . 22)
+            (:subject)))
+    )
+
+  ;; not sure about this...
+  (use-package mu4e-dashboard
+    :straight (mu4e-dashboard
+               :host github
+               :repo "rougier/mu4e-dashboard"
+               :branch "main"))
+
+#+end_src
+
 * Appendix A: ~emacsdc~ script
 
 Here's a wrapper script that'll start =emacs --daemon= if there isn't one, and then launche =emacsclient= on the arguments.  I'd recommend installing with ~ln -s emacsdc ~/.local/bin/~ or something.  Then you can set it as your ~$EDITOR~!
-- 
cgit 1.4.1-21-gabe81