summaryrefslogtreecommitdiff
path: root/share/mutt-wizard.muttrc
blob: 4a72269b639e15d84c792515509b0c4217e22d8a (plain)
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
# vim: filetype=neomuttrc
# This file contains all of mutt-wizard's default settings.
# mutt-wizard will have this file sourced from your muttrc.
# In the interest of seamless updating, do not edit this file.
# If you want to override any settings, set those in your muttrc.
set send_charset = "us-ascii:utf-8"
set mailcap_path = $HOME/.config/mutt/mailcap:/usr/local/share/mutt-wizard/mailcap:$mailcap_path
set mime_type_query_command = "file --mime-type -b %s"
set date_format = "%y/%m/%d %I:%M%p"
set index_format = "%2C %<H?[%H]> %Z %?X?A& ? %D %-15.15F %s (%-4.4c)"
set sort = 'reverse-date'
set smtp_authenticators = 'gssapi:login'
set query_command = "abook -f ~/.config/abook/addressbook --mutt-query '%s'"
set rfc2047_parameters = yes
set sleep_time = 0	# Pause 0 seconds for informational messages
set markers = no		# Disables the `+` displayed at line wraps
set mark_old = no		# Unread mail stay unread until read
set mime_forward = no	# mail body is forwarded as text
set forward_attachments = yes	# attachments are forwarded with mail
set wait_key = no		# mutt won't ask "press key to continue"
set fast_reply			# skip to compose when replying
set fcc_attach			# save attachments with the body
set forward_format = "Fwd: %s"	# format of subject when forwarding
set forward_quote		# include message in forwards
set reverse_name		# reply as whomever it was to
set include			# include message in replies
set mail_check = 60 # to avoid lags using IMAP with some email providers (yahoo for example)
auto_view application/pgp-encrypted
auto_view text/* application/* image/* audio/*

#set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages.
alternative_order text/plain text/enriched text/html

# spam
spam "X-Spam-Status: Yes" "90+/SA"
spam "X-Spam-Score: ([0-9\\.]+).*" "SA: %1"
set spam_separator = ", "
set pager_format = "%C/%m %Z %[%H:%M] %.20v, %s%* %?H? [%H] ? (%P)"

bind index,pager i noop
bind index,pager g noop
bind index \Cf noop
bind index,pager M noop
bind index,pager C noop

# General rebindings
bind index gg first-entry
bind index j next-entry
bind index k previous-entry
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind index G last-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index \Ca toggle-read
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind index,query <space> tag-entry
#bind browser h goto-parent
macro browser h "<change-dir><kill-line>..<enter>" "Go to parent folder"
bind index,pager H view-raw-message
bind browser l select-entry
bind browser gg top-page
bind browser G bottom-page
bind pager gg top
bind pager G bottom
bind index,pager,browser d half-down
bind index,pager,browser u half-up
bind index,pager S sync-mailbox
bind index,pager R group-reply
bind index \031 previous-undeleted	# Mouse wheel
bind index \005 next-undeleted		# Mouse wheel
bind pager \031 previous-line		# Mouse wheel
bind pager \005 next-line		# Mouse wheel
bind editor <Tab> complete-query

macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive"
macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive"
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"
macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts"
macro index,pager gp "<change-folder>=Spam<enter>" "go to spam"
macro index,pager Mp ";<save-message>=Spam<enter>" "move mail to spam"
macro index,pager Cp ";<copy-message>=Spam<enter>" "copy mail to spam"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"

#set crypt_auto_sign = yes
#set crypt_opportunistic_encrypt = yes
#set pgp_self_encrypt = yes
#set pgp_default_key  = 'your@gpgemailaddre.ss'
macro index \Cg "<enter-command>unset wait_key<enter><shell-escape>gpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>"  "publish GPG key to WKS provider"
macro index \Ch "<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "confirm GPG publication"

macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
macro index O "<shell-escape>mailsync<enter>" "run mailsync to sync all mail"
macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>printf 'Enter a search term to find with notmuch: '; read x; echo \$x >\"\${XDG_CACHE_HOME:-\$HOME/.cache}/mutt_terms\"<enter><limit>~i \"\`notmuch search --output=messages \$(cat \"\${XDG_CACHE_HOME:-\$HOME/.cache}/mutt_terms\") | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/g for@a; s/\\$/\\\\\\$/g for@a;print@a' \`\"<enter>" "show only messages matching a notmuch pattern"
macro index A "<limit>all\n" "show all messages (undo limit)"

# urlscan
macro index,pager \Cw "<pipe-message>urlscan -d -W<Enter>" "call urlscan to extract URLs out of a message"
macro attach,compose \Cw "<pipe-entry>urlscan -d -W<Enter>" "call urlscan to extract URLs out of a message"

# Sidebar mappings
set sidebar_visible = yes
set sidebar_width = 20
set sidebar_short_path = yes
set sidebar_next_new_wrap = yes
set mail_check_stats
set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?'
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible

# make sure that you are using mutt linked against slang, not ncurses, or
# suffer the consequences of weird color issues. use "mutt -v" to check this.

# custom body highlights -----------------------------------------------
# highlight my name and other personally relevant strings
#color body               yellow          default         "(ethan|schoonover)"
# custom index highlights ----------------------------------------------
# messages which mention my name in the body
#color index              yellow          default         "~b \"phil(_g|\!| gregory| gold)|pgregory\" !~N !~T !~F !~p !~P"
#color index              black           brightwhite     "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~N !~T !~F !~p !~P"
#color index              yellow          cyan            "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~T !~F !~p !~P"
#color index              yellow          magent          "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~F !~p !~P"
## messages which are in reference to my mails
#color index              magent          default         "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" !~N !~T !~F !~p !~P"
#color index              magent          brightwhite     "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~N !~T !~F !~p !~P"
#color index              magent          cyan            "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~T !~F !~p !~P"
#color index              magent          red             "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~F !~p !~P"

# for background in 16 color terminal, valid background colors include:
# base03, bg, black, any of the non brights

### basic colors -------------------------------------------------------

color normal              default         default
color error               red             default
color tilde               black           default
color message             cyan            default
color markers             red             white
color attachment          white           default
color search              brightmagenta   default
color status              brightyellow    black
color indicator           brightwhite     brightblack
color tree                brightyellow    default                                     # arrow in threads

### basic monocolor screen ---------------------------------------------

mono  bold                bold
mono  underline           underline
mono  indicator           reverse
mono  error               bold

### index --------------------------------------------------------------

# color index               red             default         "~D(!~p|~p)"                # deleted
# color index               black           default         ~F                          # flagged
# color index               brightred       default         ~=                          # duplicate messages
# color index               brightgreen     default         "~A!~N!~T!~p!~Q!~F!~D!~P"   # the rest
# color index               yellow          default         "~A~N!~T!~p!~Q!~F!~D"       # the rest, new
color index_author        red             default         '.*'                        # all messages
color index_number        blue            default         '.*'                        # all messages
color index_subject       cyan            default         '.*'                        # all messages
color index               red             default         "~A"                        # all messages
color index               red             default         "~E"                        # expired messages
color index               brightyellow    default         "~N"                        # new messages
color index_author        brightred       default         "~N"                        # new messages
color index_subject       brightcyan      default         "~N"                        # new messages
color index               blue            default         "~O"                        # old messages
color index               magenta         default         "~Q"                        # messages that have been replied to
color index               yellow          default         "~R"                        # read messages
color index               blue            default         "~U"                        # unread messages
color index               blue            default         "~U~$"                      # unread, unreferenced messages
color index               yellow          default         "~v"                        # messages part of a collapsed thread
color index               yellow          default         "~P"                        # messages from me
color index               cyan            default         "~p!~F"                     # messages to me
color index               cyan            default         "~N~p!~F"                   # new messages to me
color index               cyan            default         "~U~p!~F"                   # unread messages to me
color index               yellow          default         "~R~p!~F"                   # messages to me
color index               brightgreen     default         "~F"                        # flagged messages
color index_author        brightgreen     default         "~F"                        # flagged messages
color index_subject       brightgreen     default         "~F"                        # flagged messages
color index               red             default         "~F~p"                      # flagged messages to me
color index               red             default         "~N~F"                      # new flagged messages
color index               red             default         "~N~F~p"                    # new flagged messages to me
color index               red             default         "~U~F~p"                    # new flagged messages to me
color index               brightblack     default         "~D"                        # deleted messages
color index_author        brightblack     default         "~D"                        # deleted messages
color index_subject       brightblack     default         "~D"                        # deleted messages
color index               brightcyan      default         "~v~(!~N)"                  # collapsed thread with no unread
color index               yellow          default         "~v~(~N)"                   # collapsed thread with some unread
color index               green           default         "~N~v~(~N)"                 # collapsed thread with unread parent
# statusbg used to indicated flagged when foreground color shows other status
# for collapsed thread
color index               red             black           "~v~(~F)!~N"                # collapsed thread with flagged, no unread
color index               yellow          black           "~v~(~F~N)"                 # collapsed thread with some unread & flagged
color index               green           black           "~N~v~(~F~N)"               # collapsed thread with unread parent & flagged
color index               green           black           "~N~v~(~F)"                 # collapsed thread with unread parent, no unread inside, but some flagged
color index               cyan            black           "~v~(~p)"                   # collapsed thread with unread parent, no unread inside, some to me directly
color index               yellow          red             "~v~(~D)"                   # thread with deleted (doesn't differentiate between all or partial)
# color index               yellow          default         "~(~N)"                     # messages in threads with some unread
# color index               green           default         "~S"                        # superseded messages
color index               brightyellow    blue            "~T"                        # tagged messages
color index_author        brightred       blue            "~T"                        # tagged messages
color index_subject       brightcyan      blue            "~T"                        # tagged messages
# color index               brightred       red             "~="                        # duplicated messages

### message headers ----------------------------------------------------

#color header             brightgreen     default         "^"
color hdrdefault          brightblue      default
color header              brightmagenta   default         "^(From)"
color header              brightcyan      default         "^(Subject)"
color header              brightwhite     default         "^(CC|BCC)"

### sidebar ------------------------------------------------------------

color sidebar_background  default         default
color sidebar_divider     brightblack     black
color sidebar_flagged     red             black
color sidebar_highlight   green           default
color sidebar_indicator   brightblack     white
color sidebar_new         yellow          black
color sidebar_ordinary    default         default
color sidebar_spool_file  brightblue      default
color sidebar_unread      brightcyan      default
mono  sidebar_indicator   reverse

### body ---------------------------------------------------------------

color quoted              green           default
color quoted1             blue            default
color quoted2             cyan            default
color quoted3             yellow          default
color quoted4             red             default
color quoted5             brightred       default

color signature           brightgreen     default
color bold                black           default
color underline           black           default
color normal              default         default

color body                brightcyan      default         "[;:][-o][)/(|]"            # emoticons
color body                brightcyan      default         "[;:][)(|]"                 # emoticons
color body                brightcyan      default         "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\
                                                           |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\
                                                           |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?"
color body                brightcyan      default         "[ ][*][^*]*[*][ ]?"        # more emoticon?
color body                brightcyan      default         "[ ]?[*][^*]*[*][ ]"        # more emoticon?

# pgp ------------------------------------------------------------------

color body                red             default         "(BAD signature)"
color body                cyan            default         "(Good signature)"
color body                brightblack     default         "^gpg: Good signature .*"
color body                brightyellow    default         "^gpg: "
color body                brightyellow    red             "^gpg: BAD signature from.*"
mono  body                bold                            "^gpg: Good signature"
mono  body                bold                            "^gpg: BAD signature from.*"

# regex ----------------------------------------------------------------

# URL
color body                red             default         "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"

# and a heavy handed email regex
# color body               magent        default         "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"

# email addresses
color body                brightred       default         "(mailto)?:?[ ]?[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+"

# phone numbers
color body                brightmagenta   default         "[\(]?(\\+[0-9]{1,2})?[\) -]?[ ]*[\(]?([0-9]{3})[\)]?[- ]?[0-9]{3,4}[- ]?[0-9]{4}"

# passcode
color body                brightgreen     default         "([^0-9]|^)[0-9]{6}([^0-9]|$)"

# tracking numer
color body                brightgreen     default         "[A-Za-z]{2}[0-9]{7}[A-Za-z]{2}$"
color body                brightgreen     default         "[0-9]{20,22}$"
color body                brightgreen     default         "1Z[0-9A-Za-z]{16}$"
color body                brightgreen     default         "(TBA|[a-zA-Z])?[0-9]{12}$"
color body                brightgreen     default         "JD[0-9]{10,39}$"
color body                brightgreen     default         "[0-9]{12}$"

# unsubscribe
color body                brightred       default         "unsubscribe"

# extra ----------------------------------------------------------------

# various smilies and the like
color body               brightwhite     default         "<[Gg]>"                    # <g>
color body               brightwhite     default         "<[Bb][Gg]>"                # <bg>
color body               yellow          default         " [;:]-*[})>{(<|]"          # :-) etc...
# *bold*
color body               blue            default         "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
mono  body               bold                            "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
# _underline_
color body               blue            default         "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
mono  body               underline                       "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
# /italic/  (Sometimes gets directory names)
color body               blue            default         "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
mono body                underline                       "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"

# Border lines.
color body               blue            default         "( *[-+=#*~_]){6,}"

# folder-hook .                  "color status        black         yellow"
# folder-hook gmail/inbox        "color status        black         yellow"
# folder-hook gmail/important    "color status        black         yellow"