dotfiles/emacs/+mail.el

75 lines
2.4 KiB
EmacsLisp

;;; +mail.el -*- lexical-binding: t; -*-
; I use ProtonMail with my domainname via ProtonBridge synced via mbsync to mu.
; This may look weird because of that.
; Add proton bridge cert to trust store when it's present.
; See dotfiles for more info.
(let ((bridgecert (expand-file-name "~/.config/mbsync/transient/bridge.crt")))
(when (file-exists-p bridgecert)
(require 'gnutls)
(add-to-list 'gnutls-trustfiles bridgecert)
)
)
; Setup mail sending and mu4e structure.
(set-email-account! "ProtonMail"
'((mu4e-sent-folder . "/Sent")
(mu4e-drafts-folder . "/Drafts")
(mu4e-trash-folder . "/Trash")
(mu4e-refile-folder . "/All Mail")
(mu4e-update-interval . 300)
(mu4e-change-filenames-when-moving . t)
(user-mail-address . "james@jpatrick.io")
(message-send-mail-function . 'smtpmail-send-it)
(smtpmail-auth-credentials . "~/.authinfo.gpg")
(smtpmail-smtp-service . 1025)
(smtpmail-smtp-server . "127.0.0.1")
(smtpmail-smtp-user . "james@jpatrick.io")
)
t)
; Helper for adding to bookmarks. Probably overkill....
(defcustom mu4e-bookmarks
'(( :name "Unread messages"
:query "flag:unread AND NOT flag:trashed"
:key ?u)
( :name "Today's messages"
:query "date:today..now"
:key ?t)
( :name "Last 7 days"
:query "date:7d..now"
:hide-unread t
:key ?w)
( :name "Messages with images"
:query "mime:image/*"
:key ?p))
"List of pre-defined queries that are shown on the main screen.
Each of the list elements is a plist with at least:
:name - the name of the query
:query - the query expression
:key - the shortcut key.
Optionally, you add the following:
:hide - if t, bookmark is hdden from the main-view and speedbar.
:hide-unread - do not show the counts of unread/total number
of matches for the query. This can be useful if a bookmark uses
a very slow query. :hide-unread is implied from :hide.
"
:type '(repeat (plist))
:group 'mu4e)
(add-to-list 'mu4e-bookmarks
'( :name "Recent Account Msgs"
:query "maildir:/Folders/subscriptions date 7d..now AND flag:unread"
:key ?s)
)
(add-to-list 'mu4e-bookmarks
'( :name "Unread Personal"
:query "maildir:/INBOX date 7d..now AND flag:unread"
:key ?i)
)