-
Notifications
You must be signed in to change notification settings - Fork 1
/
rgr-email.el
163 lines (154 loc) · 8.39 KB
/
rgr-email.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
(use-package notmuch
:init
(defun rgr/notmuch-new()
(message "refreshing notmuch")
(call-process-shell-command "notmuch new" nil 0))
:hook
(notmuch-hello-mode . rgr/notmuch-new)
)
(use-package mu4e
;;:disabled
:straight ( :host github
:branch "release/1.10"
:repo "djcb/mu"
:files ("mu4e/*.el" "build/mu4e/mu4e-meta.el" "build/mu4e/mu4e-config.el" "build/mu4e/mu4e.info")
:main "mu4e/mu4e.el"
:pre-build (("./autogen.sh")
("ninja" "-C" "build")
(make-symbolic-link (expand-file-name "./build/mu/mu")
(expand-file-name "~/bin/mu") 'ok-if-exists)))
:commands (mu4e mu4e-update-index)
:custom
( mayil-user-agent 'mu4e-user-agent )
( mail-user-agent 'mu4e-user-agent )
( message-send-mail-function 'smtpmail-send-it )
( mu4e-attachment-dir "~/Downloads" )
( mu4e-change-filenames-when-moving t )
( mu4e-compose-context-policy 'ask )
( mu4e-confirm-quit nil )
( mu4e-context-policy 'pick-first )
( mu4e-compose-reply-recipients 'sender )
( mu4e-headers-include-related nil )
( mu4e-headers-show-threads nil ) ; Use "P" to toggle threading
( mu4e-decryption-policy 'ask )
( mu4e-hide-index-messages t )
( mu4e-mu-binary (expand-file-name "build/mu/mu" (straight--repos-dir "mu")) )
( mu4e-update-interval nil )
( mu4e-use-fancy-chars t )
( mu4e-view-prefer-html nil )
( mu4e-view-show-addresses t )
( smtpmail-smtp-service 587 )
( user-full-name "Richard G.Riley" )
:config
(use-package mu4e-alert
:init
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display))
(use-package mu4e-column-faces
:after mu4e
:config (mu4e-column-faces-mode))
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "aGmx"
:enter-func (lambda () (mu4e-message "gmx context")(rgr/mu4e-refresh))
:match-func (lambda (msg)
(when msg
(string-match-p "^/gmx" (mu4e-message-field msg :maildir))))
:vars '( ( user-mail-address . "[email protected]" )
( user-full-name . "Richard G. Riley" )
( smtpmail-smtp-server . "mail.gmx.net")
( mu4e-get-mail-command . "getmails gmx gmx-special-interest")
( mu4e-refile-folder . "/gmx/Archive" )
( mu4e-sent-folder . "/gmx/Sent" )
( mu4e-sent-messages-behavior . sent)
( mu4e-trash-folder . "/gmx/Bin" )
( mu4e-drafts-folder . "/gmx/Drafts" )
;; (mu4e-maildir-shortcuts .
;; (("/gmx/INBOX" . ?i)
;; ("/gmx/Sent" . ?s)
;; ("/gmx/Bin" . ?b)
;; ("/gmx/Drafts" . ?d)
;; ("/gmx/Spam" . ?p)
;; ("/gmx/Archive" . ?a)))
( mu4e-bookmarks . ((:name "Inbox" :query "maildir:/gmx/INBOX and flag:unread" :key ?i)
(:name "Learning" :query "maildir:/gmx/Learning* and flag:unread" :key ?l)
(:name "All Today's messages" :query "maildir:/gmx/* AND NOT (maildir:/gmx/Spam OR maildir:/gmx/Sent) AND date:today..now " :key ?t)
(:name "Last 7 days" :query "maildir:/gmx/* AND NOT (maildir:/gmx/Spam OR maildir:/gmx/Sent) AND date:7d..now" :hide-unread t :key ?w)
(:name "All" :query "maildir:/gmx/* and not (maildir:/gmx/Spam or maildir:/gmx/Bin)" :key ?a)
(:name "Bin" :query "maildir:/gmx/Bin" :key ?b)
;; (:name "Messages with images" :query "maildir:/gmx/* AND NOT maildir:/gmx/Spam AND NOT maildir:/gmx/Sent" :key ?m)
(:name "Spam" :query "maildir:/gmx/Spam AND date:7d..now" :hide-unread t :key ?p)))
( mu4e-compose-signature .
(concat
"Richard G. Riley\n"
"Ein bier, ein Helbing.\n"))))
,(make-mu4e-context
:name "bGmail"
:enter-func (lambda () (mu4e-message "gmail context") (rgr/mu4e-refresh))
;; no leave-func
;; we match based on the maildir of the message
;; this matches maildir /Arkham and its sub-directories
:match-func (lambda (msg)
(when msg
(string-match-p "^/gmail" (mu4e-message-field msg :maildir))))
:vars '( ( user-mail-address . "[email protected]" )
( user-full-name . "Richie" )
( smtpmail-smtp-server . "smtp.gmail.com")
( mu4e-get-mail-command . "getmails gmail")
( mu4e-refile-folder . "/gmail/Archive" )
( mu4e-sent-folder . "/gmail/Sent" )
( mu4e-sent-messages-behavior . delete)
( mu4e-trash-folder . "/gmail/Bin" )
( mu4e-drafts-folder . "/gmail/Drafts" )
;; (mu4e-maildir-shortcuts .
;; (("/gmail/INBOX" . ?i)
;; ("/gmail/Sent" . ?s)
;; ("/gmail/Bin" . ?b)
;; ("/gmail/Drafts" . ?d)
;; ("/gmail/Spam" . ?p)
;; ("/gmail/Archive" . ?a)))
( mu4e-bookmarks . ((:name "Inbox" :query "maildir:/gmail/INBOX and flag:unread" :key ?i)
(:name "All Today's messages" :query "maildir:/gmail/* AND NOT (maildir:/gmail/Spam OR maildir:/gmail/Sent) AND date:today..now " :key ?t)
(:name "Last 7 days" :query "maildir:/gmail/* AND NOT (maildir:/gmail/Spam OR maildir:/gmail/Sent) AND date:7d..now" :hide-unread t :key ?w)
(:name "All" :query "maildir:/gmail/* and not (maildir:/gmail/Spam or maildir:/gmail/Bin)" :key ?a)
(:name "Bin" :query "maildir:/gmail/Bin" :key ?b)
;; (:name "Messages with images" :query "maildir:/gmail/* AND NOT maildir:/gmail/Spam AND NOT maildir:/gmail/Sent" :key ?m)
(:name "Spam" :query "maildir:/gmail/Spam AND date:7d..now" :hide-unread t :key ?p)))
( mu4e-compose-signature . "Please change my email to '[email protected]'.")))))
(defun mu4e-smarter-compose ()
"My settings for message composition."
(set-fill-column 72)
(flyspell-mode))
(defun rgr/mu4e-refresh()
(interactive)
(when (featurep 'alert)
(alert "refreshing mu4e indexes"))
(call-interactively #'(lambda () (interactive)(mu4e-update-mail-and-index t))))
(defun rgr/mu4e-default-context()
(interactive)
(mu4e)
(mu4e-context-switch nil "bGmail"))
(add-to-list 'mu4e-view-actions
'("ViewInBrowser" . mu4e-action-view-in-browser) t)
(add-to-list 'mu4e-view-actions
'("XWidget View" . mu4e-action-view-with-xwidget) t)
(add-to-list 'mu4e-view-actions
'("Markall as read" . mu4e-headers-mark-all-unread-read) t)
(require 'mu4e-contrib)
:hook ((mu4e-view-rendered . visual-line-mode)
(mu4e-compose-mode . mu4e-smarter-compose)
(mu4e-view-rendered .
(lambda()
;; try to emulate some of the eww key-bindings
(local-set-key (kbd "<tab>") 'shr-next-link)
(local-set-key (kbd "<backtab>") 'shr-previous-link))))
:bind (("C-c u" . rgr/mu4e-default-context)
(:map mu4e-main-mode-map
("m" . mu4e-compose-new))
(:map mu4e-main-mode-map
("g" . rgr/mu4e-refresh))
(:map mu4e-headers-mode-map
("v" . mu4e-view-action)
("C-c u" . mu4e-headers-mark-all-unread-read))))
;;:map mu4e-view-mode-map
;; ("V" . '(lambda()(message "%s" (mu4e-message-at-point))))))) ;; mu4e-action-view-in-browser))))
(provide 'rgr/email)