]> git.phdru.name Git - dotfiles.git/blob - .muttrc
Feat(recode-filenames-recursive): Allow to omit parameters
[dotfiles.git] / .muttrc
1 #
2 # User configuration file for Mutt
3 #
4
5 # Note: $folder should be set _before_ any other path vars where `+' or `='
6 # is used because paths are expanded when parsed
7 #
8 #set folder=~/Mail                # Where I keep my mailboxes; I am happy with this default
9
10 # Character set for my terminal and config files (including aliases)
11 set charset=`case "$LC_CTYPE" in *UTF-8) echo utf-8 ;; *) echo koi8-r ;; esac`
12 set assumed_charset="us-ascii:utf-8:windows-1251:koi8-r" # Character sets for mail without a charset
13 set config_charset=koi8-r # Character set for this config file and alias files
14 set send_charset="us-ascii:iso-8859-1:koi8-r:windows-1251:utf-8" # Character sets for outgoing mail
15 charset-hook x-unknown koi8-r    # Show unknow encoding as koi8-r
16 charset-hook windows-1251 cp1251 # Autoconvert windoze encoding
17
18 # source aliases
19 source =mutt/aliases
20
21 # All my addresses
22 alternates `awk '{s=s"|"$0} END {print substr(s,2)}' $HOME/mail/misc/.myemail` # All my addresses
23
24 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25 #
26 # Mailboxes to watch for new mail
27 #
28 #       mailboxes <path1> [ <path2> ... ]
29 #
30
31 mailboxes ! =admin =block =bulk =spam `echo $HOME/mail/lists/* | sed s#$HOME/mail/#=#g`
32
33 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34 #
35 # Settings
36 #
37
38 #set indent_string='%v> '         # How to quote replied text
39
40 # Settings for dumb slow term
41 set ascii_chars=`[ -n "$SLOWTERM" ] && echo yes || echo no` # Use ASCII instead of ACS chars for threads
42 set arrow_cursor=`[ -n "$SLOWTERM" ] && echo yes || echo no` # Draw a simple cursor on slow terminals
43
44 set index_format="%4C %Z %{%b %d} %-15.15F (%4c) %s" # Somewhat different index format, which works nicely with mail lists.
45 set pager_format="%4C %Z %[%b %d] %-15.15F (%4l) %s %* ---(%P)---" # Mostly match index_format
46
47 set sort=mailbox-order           # Primary sorting method
48 #set sort=threads                 # Sort by threads,...
49 set sort_aux=date                # ...then by date
50
51 set sort_alias=unsorted
52 set sort_browser=alpha
53
54 set history=1000                 # Number of lines of history in memory
55 set history_file==tmp/.mutt_history
56 set save_history=1000            # Number of lines of history in file
57
58 set read_inc=10                  # Progress indicator when reading folders.
59 set write_inc=10                 # Progress indicator when writing folders.
60
61 set allow_8bit                   # Never do Q-P encoding on legal 8-bit chars
62 set abort_unmodified=no          # Let me send empty messages
63 set alias_file==tmp/aliases      # Where to store aliases
64 set attribution="`case "$LC_TIME" in ru_RU*) echo 'В %{%a, %d %b %Y в %I:%M:%S%p %Z} %f написал(а):' ;; *) echo 'On %d, %f wrote:' ;; esac`" # `
65 set attribution_locale=`echo $LC_TIME` # Locale to format dates
66 set beep=no                      # Never beep on errors
67 set collapse_unread=no           # Do not collapse thread with unread messages
68 set confirmappend=no             # Don't ask me if i want to append to mailboxes
69 set fast_reply                   # Skip initial prompts when replying if no autoedit
70 set forward_format="[Fwd: %s]"   # Subject to use when forwarding messages
71 set help                         # Show the help lines
72 set ignore_list_reply_to         # Ignore Reply-To headers pointing to mailing lists.
73 set include=yes                  # Always include a copy when replying.
74 set mail_check=30                # How often (in seconds) to poll for new mail
75 set mark_old=no                  # Distinguish between seen (but unread) and new messages
76 set mask=""                      # Show dot-files in the file browser
77 set menu_scroll                  # No implicit next-page/prev-page
78 set move=no                      # Do not move read messages to ~/mbox
79 set pager_context=1              # No. of lines of context to give when scrolling
80 set pager_index_lines=6          # How many index lines to show in the pager
81 set pager_stop                   # Don't move to the next message on next-page
82 set postponed==tmp/.mutt_postponed
83 set print=ask-no                 # Don't waste paper
84 set recall=no                    # When I say "compose", ask me whether I want to continue composing a postponed message.
85 set reply_regexp="^((re([\\[0-9\\]+])*|aw|на):[ \t]*)+[ \t]*" # A regular expression to detect replies
86 set rfc2047_parameters           # Sometimes, I get mails which use a bogus encoding for MIME parameters. Setting this shouldn't harm.
87 set sendmail_wait=5              # Wait 5 seconds before putting sendmail to the background.
88 set sig_dashes=no                # Do not add "-- " before my sig - I already have it there
89 set status_on_top                # I prefer the status bar on top
90 set suspend=no                   # Do not suspend on Ctrl+Z
91 set tilde                        # Indicate empty lines in the pager.
92 set tmpdir=~/tmp                 # Temporary files aren't stored in public places.
93 set use_domain=no                # Don't qualify local addresses with $domain
94 set use_envelope_from=yes
95 set use_ipv6=no                  # Speed up DNS
96 set wait_key=no                  # Do not wait for a key after running external programs, pipes
97
98 set xterm_set_titles
99 set xterm_title="%f: %?m?%m messages&no messages?%?n? N:%n?%?d? D:%d?%?b? [%b new mboxes]? [$USER@%h] mutt"
100 set xterm_icon="%f: %m%?n?:%n?%?d?/%d?%?b? [%b]? [$USER@%h] mutt"
101
102 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
103 #
104 # MIME settings
105 #
106
107 alternative_order text/enriched text/plain text
108
109 #auto_view text/html
110 #auto_view application/ms-tnef text/x-vcard
111 #auto_view application/x-gzip application/x-gunzip
112 #auto_view application/rtf
113 #set implicit_autoview # Use copiousoutput filters from mailcap for all types of attachments
114
115 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
116 #
117 # Encryption: GnuPG
118 #
119 source /usr/share/doc/mutt/examples/gpg.rc
120 set crypt_use_gpgme=no
121 set pgp_use_gpg_agent
122
123 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
124 #
125 # Header fields I don't normally want to see
126 #
127 ignore *                         # Ignore all lines by default
128
129 # I do want to see these fields, though!
130 unignore date from reply-to mail-followup-to followup-to to x-original-to cc \
131    newsgroups subject user-agent x-mailer x-url x-face
132
133 # Default list of header fields to weed when displaying
134 #
135 #ignore "from " received content- mime-version status x-status message-id
136 #ignore sender references return-path lines
137
138 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
139 #
140 # Specify the order of the headers to appear when displaying a message
141 #
142 #       hdr_order <hdr1> [ <hdr2> ... ]
143 #
144
145 hdr_order date from reply-to mail-followup-to followup-to to x-original-to cc \
146    newsgroups subject user-agent x-mailer x-url x-face
147
148 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
149 #
150 # My special headers
151 #
152
153 my_hdr X-Attribution: phd
154
155 my_hdr X-Face: \"4chVP^f8\;3Bi>x\"ic0%DuP(ZLyn:\;kzQ1njs]5,GRZG<{<\\~\`|Shxi7|)d|8uO~HFRfyym\n\
156  {[xs@OYG]2Q]0\#}0sjJp\`1^1+B6]A2+{9fW=S<O7^\"hul]^|AGtiI7SkYF-2VD?UH*h_!zuCIf+^F7\n\
157  c0x8?W,UfhCAx^YY\#1ALhvG\\2yG}LW:)zw\#1\;Yajq\"hK~S # `
158
159 my_hdr X-Operating-System: Debian GNU/Linux
160
161 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
162 #
163 # Identify mailing lists I subscribe to
164 #
165 #       lists <list-name> [ <list-name> ... ]
166
167 subscribe (python-(announce|dev|ideas)|.*-(list|sig))@python\.org \
168    core-workflow@python\.org .*@moderators\.isc\.org \
169    (durus|quixote)-users@mems-exchange\.org pysqlite@lists\.initd\.org \
170    .*@lists\.sourceforge\.net .*@vex\.net egenix-users@egenix\.com \
171    .*@googlegroups\.com mlug@unixcenter\.ru
172
173 #lists
174
175 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
176 #
177 # Change settings based on mailbox
178 #
179 #       folder-hook [!]<regexp> <command>
180 #
181 # <command> is executed when opening a mailbox matching <pattern>
182
183 # Restore defaults
184 folder-hook .* "\
185    set envelope_from_address="phd@phdru.name"; \
186    my_hdr From: Oleg Broytman <phd@phdru.name>; \
187    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
188    my_hdr X-Url: https://phdru.name/; \
189    set record==sent-mail; \
190    set signature==signatures/phd@phdru.name"
191
192 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
193 #
194 # Multiple spool mailboxes
195 #
196 #       mbox-hook [!]<pattern> <mbox-mailbox>
197 #
198 # Read mail in <pattern> is moved to <mbox-mailbox> when <pattern> is closed.
199
200 #mbox-hook =mutt-users.in =mutt-users
201 #mbox-hook +TEST +inbox
202
203 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
204 #
205 # Specify default filename when saving messages
206 #
207 #       save-hook [!]<pattern> <mailbox>
208 #
209 # <mailbox> is provided as default when saving messages from <pattern>
210
211 #save-hook mutt- =mutt-mail
212 #save-hook aol\.com +spam
213
214 save-hook .* =inbox
215
216 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
217 #
218 # Specify where to save composed messages
219 #
220 #       fcc-hook [!]<pattern> <mailbox>
221 #
222 # <pattern> is recipient(s), <mailbox> is where to save a copy
223
224 #fcc-hook joe +joe
225 #fcc-hook bob +bob
226
227 #fcc-hook .* +sent
228
229 fcc-hook .* =sent-mail
230
231 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
232 #
233 # Change settings based upon message recipient
234 #
235 #       send-hook [!]<pattern> <command>
236 #
237 # <command> is executed when sending mail to an address matching <pattern>
238
239 #send-hook mutt- 'set signature=~/.sigmutt; my_hdr From: Mutt User <user@example.com>'
240
241 # Restore defaults
242 send-hook .* "\
243    set envelope_from_address="phd@phdru.name"; \
244    set followup_to=yes; \
245    my_hdr From: Oleg Broytman <phd@phdru.name>; \
246    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
247    my_hdr X-Url: https://phdru.name/; \
248    unmy_hdr Mail-Followup-To; \
249    unmy_hdr X-Skip-DKIM-Sig; \
250    set signature==signatures/phd@phdru.name"
251
252 send-hook "~L '@.*\.(r|s)u$'" "\
253    my_hdr From: Олег Бройтман <phd@phdru.name>; \
254    my_hdr Reply-To: Олег Бройтман <phd@phdru.name>; \
255    set signature='iconv -f koi8-r ~/mail/signatures/phd@phdru.name-ru|'"
256
257 send-hook "~L '@(mail|list|inbox|bk|sweb|spaceweb|ulmart)\.ru'" "\
258    set envelope_from_address="phd@mail.ru"; \
259    my_hdr From: Олег Бройтман <phd@mail.ru>; \
260    my_hdr Reply-To: Олег Бройтман <phd@mail.ru>; \
261    my_hdr X-Url: https://my.mail.ru/mail/phd; \
262    set signature='iconv -f koi8-r ~/mail/signatures/phd@mail.ru|'"
263
264 send-hook "~L '(@|\.)(((ya|yandex|narod)\.ru)|(yandex\.com)|yandex-team\.ru)$'" "\
265    set envelope_from_address="phd2@yandex.ru"; \
266    my_hdr From: Олег Бройтман <phd2@yandex.ru>; \
267    my_hdr Reply-To: Олег Бройтман <phd2@yandex.ru>; \
268    my_hdr X-Url: http://phd2.ya.ru/; \
269    set signature='iconv -f koi8-r ~/mail/signatures/phd2@yandex.ru|'"
270
271 send-hook "~L python-announce-list@python\.org" "\
272    set followup_to=no; \
273    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
274    my_hdr Mail-Followup-To: Oleg Broytman <phd@phdru.name>, Python Mailing List <python-list@python.org>"
275
276 send-hook "~L cheetahtemplate-announce@lists\.sourceforge\.net" "\
277    set followup_to=no; \
278    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
279    my_hdr Mail-Followup-To: Oleg Broytman <phd@phdru.name>, CheetahTemplate discussion <cheetahtemplate-discuss@lists.sourceforge.net>"
280
281 send-hook ~u "\
282    unmy_hdr Reply-To; \
283    my_hdr X-Skip-DKIM-Sig: mailing list"
284
285 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
286 #
287 # Key bindings
288 #
289
290 # Change Up/Down for pager
291 bind pager <Up> previous-line
292 bind pager <Down> next-line
293
294 bind index,pager <Esc>c copy-message
295 bind index,pager <Esc>S decode-save
296
297 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
298 #
299 # Macros
300 #
301
302 # KP_Home -> Home
303 macro generic,pager,editor <F84> <Home>
304 # KP_Up -> Up
305 macro generic,pager,editor \x20b <Up>
306 # KP_Next -> PageUp
307 macro generic,pager,editor <F85> <PageUp>
308 # KP_Left -> Left
309 macro generic,pager,editor \x20c <Left>
310 # KP_Right -> Right
311 macro generic,pager,editor \x20d <Right>
312 # KP_End -> End
313 macro generic,pager,editor <F87> <End>
314 # KP_Down -> Down
315 macro generic,pager,editor \x20e <Down>
316 # KP_Prev -> PageDown
317 macro generic,pager,editor <F88> <PageDown>
318
319 macro index C \
320    <Home><change-folder><Enter> \
321    "Go to the first folder with unread messages"
322 macro pager,attach C \
323    <exit><Home><change-folder><Enter> \
324    "Go to the first folder with unread messages"
325
326 macro index,pager S \
327    <save-message>!<Enter> \
328    "Move current message to inbox"
329
330 macro index,pager <Esc>h \
331    ":auto_view text/html<Enter>" \
332    "View HTML attachments"
333 macro index,pager <Esc>H \
334    ":unauto_view text/html<Enter>" \
335    "Don't show HTML attachments"
336
337 macro index <Esc>s \
338    "<pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
339    "Send spam to SpamCop"
340 macro pager <Esc>s \
341    "<exit><pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
342    "Send spam to SpamCop"
343 macro index <Esc>z \
344    ":set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
345    "Process message from SpamCop"
346 macro pager <Esc>z \
347    "<exit>:set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
348    "Process message from SpamCop"
349
350 macro index H \
351    <Home><change-folder>!<Enter> \
352    "Go to inbox"
353 macro pager,attach H \
354    <exit><Home><change-folder>!<Enter> \
355    "Go to inbox"
356 macro index M \
357    <Home><change-folder>=sent-mail<Enter> \
358    "Go to sent-mail"
359 macro pager,attach M \
360    <exit><Home><change-folder>=sent-mail<Enter> \
361    "Go to sent-mail"
362
363 # Go to python mailbox
364 macro index Y \
365    <Home><change-folder>=lists/python<Enter> \
366    "Go to python"
367 macro pager,attach Y \
368    <exit><Home><change-folder>=lists/python<Enter> \
369    "Go to python"
370
371 # Go to STCnet "Atlas"/STM mailboxes
372 macro index \ca \
373    <Home><change-folder>=stcnet<Enter> \
374    "Go to stcnet inbox"
375 macro pager,attach \ca \
376    <exit><Home><change-folder>=stcnet<Enter> \
377    "Go to stcnet inbox"
378 macro index A \
379    <Home><change-folder>=sent-stcnet<Enter> \
380    "Go to sent-stcnet"
381 macro pager,attach A \
382    <exit><Home><change-folder>=sent-stcnet<Enter> \
383    "Go to sent-stcnet"
384
385 # Recode base64 to 8bit, html to plain text, mustdie-1251 to koi8-r, etc.
386 macro index,pager \
387    <Esc>m "<pipe-message>mimedecode | less<Enter>" \
388    "View MIME-decoded message"
389 macro index,pager E \
390    ":set editor=mimedecode.sh<Enter><edit>:set editor=vim.sh<Enter>" \
391    "MIME-decode and save"
392
393 macro index,pager <Esc>f \
394    <pipe-message>~/mail/bin/view-x-face<Enter> \
395    "Convert X-Face header to an image and display it"
396
397 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
398 #
399 # Colors
400 #
401
402 # This is for an xterm with with grayish background
403
404 #     object      foreground     background regexp/pattern
405
406 color normal      default        default
407 color hdrdefault  black          default
408
409 color header      magenta        default ^(date|x-mailer|user-agent|x-operating-system):
410 color header      blue           default ^(from|to|cc|delivered-to|reply-to|mail-followup-to|x-attribution):
411 color header      brightblack    default ^subject:
412
413 color quoted      blue           default
414 color quoted1     magenta        default
415 color quoted2     red            default
416 color quoted3     green          default
417 color quoted4     cyan           default
418 color quoted5     blue           default
419 color quoted6     magenta        default
420 color quoted7     red            default
421 color quoted8     green          default
422 color quoted9     cyan           default
423 color quoted10    blue           default
424
425 color attachment  white          green
426 color error       brightred      default
427 color index       brightblack    default ~N
428 color indicator   black          cyan
429 color message     blue           default
430 color search      black          yellow
431 color signature   magenta        default
432 color status      white          blue
433 color underline   blue           default
434
435 color markers     brightblue     default
436 color tilde       blue           default
437 color tree        blue           default
438
439 # email
440 color body        brightmagenta  default [-a-Z_0-9.+]+@[-a-Z_0-9.]+
441
442 # URLs
443 color body        brightblue     default "(((https?|ftp|gopher|telnet)://|(mailto|file|news|about|ed2k|irc|sip|magnet):)[^' \t<>\"]+)[A-Za-z0-9/]"
444
445 # Smilies (emoticons)
446 color body        brightmagenta  default " [;:]-*[dp(){}<>|\\/]| [(){}<>|\\/]-*[;:]" # :-)
447
448 # Attributes when using a mono terminal
449 mono header underline ^Subject:
450 mono quoted bold