-
Notifications
You must be signed in to change notification settings - Fork 5
/
muttrc
343 lines (278 loc) · 11.4 KB
/
muttrc
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# ~/.muttrc <via stub>: Mutt configuration
### Mail storage
# Default expansion of + or = prefixes
set folder="imaps://mail.nullroute.lt/"
# Folder to open on startup (shortcut "!")
set spoolfile="+INBOX"
# Folder to copy sent messages to (shortcut "<")
# Can be set to "^" to use the current folder
set record="+Sent"
# Folder to save drafts to
set postponed="+Drafts"
# 2019-10-25 grawity: In current NeoMutt, 'mailboxes' takes effect immediately,
# so it must be called only after the authentication-related options and hooks
# have been set.
account-hook "^imaps?://imap\.ietf\.org/$" \
'set imap_user="anonymous" imap_pass="anonymous"'
account-hook "^imaps?://mail\.nullroute\.lt/" \
'set imap_user="grawity" imap_authenticators="GSSAPI"'
account-hook "^imaps?://imap\.gmail\.com/" \
'set imap_user="[email protected]" imap_authenticators="OAUTHBEARER" imap_oauth_refresh_command="gmail-oauth"'
# When "mutt -e 'set folder=...'" is used to access other accounts, we need to
# re-evaluate the expansions in $record and $postponed.
account-hook "^imaps?://mail\.utenos-kolegija\.lt/" \
'set record="+Sent" postponed="+Drafts"'
# Note: If folder-hook patterns start with ^ or @, they will be treated as
# shortcut expansions and not as regexes. Put the regex in parens to avoid
# this. (See also section 6.2 "Mailbox Matching in Hooks".)
set connect_timeout=10
set mail_check=10
set timeout=20
set imap_headers="X-BOGOSITY X-PRIORITY AUTHENTICATION-RESULTS"
set imap_authenticators="GSSAPI:GS2-KRB5:PLAIN"
set imap_idle
# http://dev.mutt.org/trac/ticket/3242 – bug with . → /
set imap_delim_chars="/"
# Fetch subscribed folders and add them to 'mailboxes'. (Necessary for sidebar,
# which only lists those folders which are in 'mailboxes'.)
set imap_check_subscribed
# When browsing folders, only list subscribed folders by default.
set imap_list_subscribed
# Use CONDSTORE (RFC 7162) for the initial message list
# 2020-10-10: Commented out as it's not yet available in Debian's ancient neomutt
#set imap_condstore
# Use QRESYNC (RFC 7162) for the initial message list
# (Note: Requires header caching.)
# 2021-04-18: Commented out both CONDSTORE and QRESYNC as they seem to result in
# neomutt showing duplicate messages when external updates occur.
#set imap_qresync
# Automatically expunge when leaving mailbox or calling '$' (default is to ask)
#set delete
# Prompt when saving to a nonexistent mailbox only
unset confirmappend
set confirmcreate
### General
# The 'L' flag will be shown for messages sent to a "subscribed" list (but not
# for other known lists).
#
# <list-reply> will work for all known lists.
#
# If $followup_to is set, messages to a known list will have Mail-Followup-To:
# added -- only the list's own address for "subscribed" lists; the list *and*
# the sender for other (unsubscribed) lists.
subscribe ".*@computer\.rip$"
subscribe ".*@freelists\.org$"
subscribe ".*@lists\.freedesktop\.org$"
lists ".*@freelists\.org$"
lists ".*@lists\.archlinux\.org$"
lists ".*@lists\.freedesktop\.org$"
# Assume it's a subscribed message if it has "List-Post:" headers (requires
# fetching them from IMAP server)
set auto_subscribe
### Composing
set realname="Mantas Mikulėnas"
#set from="[email protected]"
set from="[email protected]"
# Don't reply-all to own addresses
alternates "^(grawity|mantas)(\\+.+)?@nullroute\.lt$"
alternates "^grawity(\\+.+)?@gmail\.com$"
alternates "^mantas(:.+)?@u(tenos-)?kolegija\.lt$"
# If 'To:' matches alternates, reply from that address instead.
set reverse_name
# Reply via Gmail if message is to a known list
#reply-hook ~l 'set from="[email protected]"'
set edit_headers
# Pass '-f $from' to sendmail (allows msmtp to auto-detect the account to use)
set use_envelope_from
### Index (message list) view
# Old-style Mutt configuration
set sort=threads
# Mutt 2.2 or later (http://www.mutt.org/relnotes/2.2/)
#set sort=threads sort_thread_groups=last-date
# NeoMutt 20211015 or later (https://neomutt.org/feature/use-threads)
#set use_threads=yes sort=date
# NeoMutt - sort threads by last activity, not by start date, so that
# old threads with new activity don't drown.
#set use_threads=yes sort=last-date
# Don't auto-collapse threads if they have unread messages
unset collapse_unread
#folder-hook . 'push <collapse-all>'
# note: collapse is confusing as 'T' does not tag collapsed child-messages
# Automatically apply actions to all tagged messages without pressing <;>
set auto_tag
# Names defined via 'alias' override displayed sender name
#set reverse_alias
### Message view
ignore *
unignore From: Subject: To: Cc: Date: Reply-To:
unignore Newsgroups:
unignore X-Mailer:
unignore User-Agent:
unignore X-Bogosity:
hdr_order Date From To Cc Subject
set pager_index_lines=6
set pager_context=3
set search_context=3
unset markers
set smart_wrap
set tilde
# other auto_view types are conditional in muttrc.sh
auto_view message/disposition-notification
auto_view message/feedback-report
unset digest_collapse
# Decode RFC2047-encoded "=?foo?Q?bar?=" attachment filenames (which are
# produced by MS Outlook, contrary to the spec).
set rfc2047_parameters=yes
### Generic appearance
unset beep
set beep_new
# Disable sleeping for 1s after certain messages, most importantly after the
# "SSL/TLS connection using TLSv1" message on startup.
set sleep_time=0
set menu_context=10
set menu_scroll
set status_on_top
set status_format="─── Folder %f (%?M?%M/?%m messages%?n?, %n new/unseen?%?o?, %o old/unread?%?d?, %d deleted?) %*─ %P ───"
set compose_format="─── Composing (%l in %a parts) %*──"
set pager_format="─── Message %C of %m: \"%s\" %*── %P ───"
# Hide footer with basic keyboard shortcuts
unset help
# Set terminal window (Debian patches)
set xterm_set_titles
# Set window title (Neomutt)
set ts_enabled=yes
set ts_status_format="Mutt %f (%?M?%M/?%m messages%?n?, %n new/unseen?%?o?, %o old/unread?)"
#set sidebar_visible
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
set sidebar_sort_method = "path"
set quote_regexp="^([ \t]*[|>:}#])+" # default
set quote_regexp="^([|>#] ?)+|^[A-Z][a-z]+>"
# It seems to be impossible to accept both ">>>" and "> > >" without the former
# skipping through levels. (Also, "Foo>" will randomly skip levels depending on
# name width.)
# "Higher levels of quoting may be colored differently ("color quoted1", "color
# quoted2", etc.). The quoting level is determined by removing the last
# character from the matched text and recursively reapplying the regular
# expression until it fails to produce a match."
spam "^X-Bogosity: Spam,.* spamicity=([0-9.]+)" "bogus"
spam "^X-Bogosity: Unsure,.* spamicity=([0-9.]+)" "unsure"
spam "^Authentication-Results: [^;]+; spf=softfail" "spf?"
spam "^Authentication-Results: [^;]+; spf=fail" "spf!"
#spam "^Authentication-Results: [^;]+; dkim=fail" "dkim!"
spam "^Authentication-Results: [^;]+; dmarc=fail" "dmarc!"
# See 3.169 index_format
# %?fmt?ifnonzero&ifzero?
# %<fmt?ifnonzero&ifzero>
set my_index_left="%4C %Z %-18.18F"
# %4C - message number [4]
# %Z - status flags [always 3]
# %-18.8F - author (or recipient) name
set my_index_mid="%s"
# %s - subject
set my_index_r1="%<g? {%g}>"
set my_index_r2="%<H? {%H}>"
set my_index_r3="%<M? ‣ %M>"
set my_index_right="$my_index_r1$my_index_r2$my_index_r3"
# %g - IMAP labels
# %H - spam flags
# %M - number of messages in collapsed thread
set my_d1="%[ %b %d, %H:%M]" # today
set my_d2="%[ %b %d, %H:%M]" # this month
set my_d3="%[ %b %d, %H:%M]" # this year
set my_d4="%[ %Y %b %d]" # older
set my_index_date="%<[y?%<[m?%<[d?$my_d1&$my_d2>&$my_d3>&$my_d4>"
# %@foo@ - index_format_hook
# %{fmt} - strftime in sender's time zone
# %[fmt] - strftime in local time zone
set index_format="$my_index_left│$my_index_mid%* $my_index_right│$my_index_date "
# %*␣ - expand pad with spaces
# XXX Neomutt stuff
# --------------------------------------------------------------------------
# Replace some tags with icons
# tag-transforms tag transformed-string { tag transformed-string ...}
# tag-transforms "inbox" "i" \
# "unread" "u" \
# "replied" "↻ " \
# "sent" "➥ " \
# "todo" "T" \
# "deleted" "DEL" \
# "invites" "CAL"
#
# The formats must start with 'G' and the entire sequence is case sensitive.
# tag-formats tag format-string { tag format-string ...}
# tag-formats "inbox" "GI" \
# "unread" "GU" \
# "replied" "GR" \
# "sent" "GS" \
# "todo" "Gt" \
# "deleted" "GD" \
# "invites" "Gi"
#
# Now instead of using '%g' or '%J' in your $index_format, which lists all tags
# in a non-deterministic order, you can something like the following which puts
# a transformed tag name in a specific spot on the index line:
# set index_format='%4C %S %[%y.%m.%d] %-18.18n %?GU?%GU& ? %?GR?%GR& ? %?GI?%GI& ? %s'
### Keybindings
bind generic,pager ,w what-key
bind index,pager <S-Up> previous-entry # [<Up> is previous-undeleted]
bind index,pager <S-Down> next-entry # [<Down> is next-undeleted]
bind index,pager <C-Up> previous-thread
bind index,pager <C-Down> next-thread
bind index,pager <Delete> delete-message
macro index,pager a "<save-message>=Archive\n"
macro index,pager \cA "<save-message>~/mbox\n"
macro index,pager A "<copy-message>~/mbox\n"
bind index,pager c copy-message
bind index,pager C change-folder
macro index,pager <Esc>i "<enter-command>unset wait_key\n<pipe-message>gpg --import |& tig\n<enter-command>set wait_key\n"
bind index,pager S copy-message
# Edit the IMAP flags (default is to edit X-Label)
bind index,pager Y modify-tags
bind index ! flag-message
bind index G last-entry
macro index * "<tag-pattern>.\n"
macro index ^ "<tag-entry><previous-entry><previous-entry>"
bind index \\ collapse-thread
macro index ,l "<limit>all\n"
macro index <Esc>l "<limit>all\n"
bind pager \' previous-line # [symmetric with <Enter>]
bind pager \\ previous-line # [symmetric with <Enter>]
bind pager G bottom
bind pager <Esc>n noop
bind pager <Esc>p check-traditional-pgp
# Backspace 'quits' Mutt or 'exits' pager
bind index \c? quit
bind pager \c? exit
# Sidebar
bind index,pager <A-Up> sidebar-prev
bind index,pager <A-Down> sidebar-next
bind index,pager <A-Left> sidebar-toggle-visible
bind index,pager <A-Right> sidebar-open
#macro index,pager <A-Up> "<sidebar-prev><sidebar-open>"
#macro index,pager <A-Down> "<sidebar-next><sidebar-open>"
bind index,pager <A-Prev> sidebar-page-up
bind index,pager <A-Next> sidebar-page-down
# Sidebar, for Windows Terminal which doesn't do Alt+Arrows
bind index,pager <C-Up> sidebar-prev
bind index,pager <C-Down> sidebar-next
bind index,pager <C-Left> sidebar-toggle-visible
bind index,pager <C-Right> sidebar-open
bind index,pager <C-Prev> sidebar-page-up
bind index,pager <C-Next> sidebar-page-down
# <Home> and <End> in some weird-ass terminals, perhaps.
#bind index <Esc>[1~ first-entry
#bind index <Esc>[4~ last-entry
#bind pager <Esc>[1~ top
#bind pager <Esc>[4~ bottom
#macro generic,index,pager <Esc>f "<enter-command>set from=grawity@"
#macro index,pager ,h "<copy-message>=Spam/ham"
#macro index,pager ,s "<copy-message>=Spam/spam"
folder-hook . '\
bind index,pager d delete-message;\
bind index,pager D delete-message;\
bind index,pager \cD delete-thread'
#folder-hook '/spam/' '\
#bind index,pager d delete-message;\
#bind index,pager D delete-message;\
#bind index,pager \cD delete-thread'
account-hook '^imaps?://' 'macro index . "<imap-fetch-mail><refresh>"'