]> git.phdru.name Git - dotfiles.git/blob - .muttrc
.muttrc: change envelope settings in sync with my exim config
[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 beep=no                      # Never beep on errors
66 set collapse_unread=no           # Do not collapse thread with unread messages
67 set confirmappend=no             # Don't ask me if i want to append to mailboxes
68 set fast_reply                   # Skip initial prompts when replying if no autoedit
69 set forward_format="[Fwd: %s]"   # Subject to use when forwarding messages
70 set help                         # Show the help lines
71 set ignore_list_reply_to         # Ignore Reply-To headers pointing to mailing lists.
72 set include=yes                  # Always include a copy when replying.
73 set locale=`echo $LC_TIME`       # Locale to format dates
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 pgp_use_gpg_agent
121
122 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
123 #
124 # Header fields I don't normally want to see
125 #
126 ignore *                         # Ignore all lines by default
127
128 # I do want to see these fields, though!
129 unignore date from reply-to mail-followup-to followup-to to x-original-to cc \
130    newsgroups subject user-agent x-mailer x-url x-face
131
132 # Default list of header fields to weed when displaying
133 #
134 #ignore "from " received content- mime-version status x-status message-id
135 #ignore sender references return-path lines
136
137 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
138 #
139 # Specify the order of the headers to appear when displaying a message
140 #
141 #       hdr_order <hdr1> [ <hdr2> ... ]
142 #
143
144 hdr_order date from reply-to mail-followup-to followup-to to x-original-to cc \
145    newsgroups subject user-agent x-mailer x-url x-face
146
147 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
148 #
149 # My special headers
150 #
151
152 my_hdr X-Attribution: phd
153
154 my_hdr X-Face: \"4chVP^f8\;3Bi>x\"ic0%DuP(ZLyn:\;kzQ1njs]5,GRZG<{<\\~\`|Shxi7|)d|8uO~HFRfyym\n\
155  {[xs@OYG]2Q]0\#}0sjJp\`1^1+B6]A2+{9fW=S<O7^\"hul]^|AGtiI7SkYF-2VD?UH*h_!zuCIf+^F7\n\
156  c0x8?W,UfhCAx^YY\#1ALhvG\\2yG}LW:)zw\#1\;Yajq\"hK~S # `
157
158 my_hdr X-Operating-System: Debian GNU/Linux
159
160 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 #
162 # Identify mailing lists I subscribe to
163 #
164 #       lists <list-name> [ <list-name> ... ]
165
166 subscribe (python-(announce|dev|ideas)|.*-(list|sig))@python\.org \
167    core-workflow@python\.org \
168    .*@moderators\.isc\.org .*@lists\.sourceforge\.net \
169    (durus|quixote)-users@mems-exchange\.org pysqlite@lists\.initd\.org \
170    .*@googlegroups\.com mlug@unixcenter\.ru
171
172 #lists
173
174 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
175 #
176 # Change settings based on mailbox
177 #
178 #       folder-hook [!]<regexp> <command>
179 #
180 # <command> is executed when opening a mailbox matching <pattern>
181
182 # Restore defaults
183 folder-hook .* "\
184    set envelope_from_address="phd@phdru.name"; \
185    my_hdr From: Oleg Broytman <phd@phdru.name>; \
186    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
187    my_hdr X-Url: http://phdru.name/; \
188    set record==sent-mail; \
189    set signature==signatures/phd@phdru.name"
190
191 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
192 #
193 # Multiple spool mailboxes
194 #
195 #       mbox-hook [!]<pattern> <mbox-mailbox>
196 #
197 # Read mail in <pattern> is moved to <mbox-mailbox> when <pattern> is closed.
198
199 #mbox-hook =mutt-users.in =mutt-users
200 #mbox-hook +TEST +inbox
201
202 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
203 #
204 # Specify default filename when saving messages
205 #
206 #       save-hook [!]<pattern> <mailbox>
207 #
208 # <mailbox> is provided as default when saving messages from <pattern>
209
210 #save-hook mutt- =mutt-mail
211 #save-hook aol\.com +spam
212
213 save-hook .* =inbox
214
215 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
216 #
217 # Specify where to save composed messages
218 #
219 #       fcc-hook [!]<pattern> <mailbox>
220 #
221 # <pattern> is recipient(s), <mailbox> is where to save a copy
222
223 #fcc-hook joe +joe
224 #fcc-hook bob +bob
225
226 #fcc-hook .* +sent
227
228 fcc-hook .* =sent-mail
229
230 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
231 #
232 # Change settings based upon message recipient
233 #
234 #       send-hook [!]<pattern> <command>
235 #
236 # <command> is executed when sending mail to an address matching <pattern>
237
238 #send-hook mutt- 'set signature=~/.sigmutt; my_hdr From: Mutt User <user@example.com>'
239
240 # Restore defaults
241 send-hook .* "\
242    set envelope_from_address="phd@phdru.name"; \
243    my_hdr From: Oleg Broytman <phd@phdru.name>; \
244    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
245    my_hdr X-Url: http://phdru.name/; \
246    set signature==signatures/phd@phdru.name"
247
248 send-hook "~L '@.*\.(r|s)u$'" "\
249    my_hdr From: Олег Бройтман <phd@phdru.name>; \
250    my_hdr Reply-To: Олег Бройтман <phd@phdru.name>; \
251    set signature='iconv -f koi8-r ~/mail/signatures/phd@phdru.name-ru|'"
252
253 send-hook "~L '@(mail|list|inbox|bk|sweb|spaceweb|ulmart)\.ru'" "\
254    set envelope_from_address="phd@mail.ru"; \
255    my_hdr From: Олег Бройтман <phd@mail.ru>; \
256    my_hdr Reply-To: Олег Бройтман <phd@mail.ru>; \
257    my_hdr X-Url: http://my.mail.ru/mail/phd; \
258    set signature='iconv -f koi8-r ~/mail/signatures/phd@mail.ru|'"
259
260 send-hook "~L '(@|\.)(((ya|yandex|narod)\.ru)|(yandex\.com)|yandex-team\.ru)$'" "\
261    set envelope_from_address="phd2@yandex.ru"; \
262    my_hdr From: Олег Бройтман <phd2@yandex.ru>; \
263    my_hdr Reply-To: Олег Бройтман <phd2@yandex.ru>; \
264    my_hdr X-Url: http://phd2.ya.ru/; \
265    set signature='iconv -f koi8-r ~/mail/signatures/phd2@yandex.ru|'"
266
267 send-hook "~L python-announce-list@python\.org" "\
268    set followup_to=no; \
269    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
270    my_hdr Mail-Followup-To: Oleg Broytman <phd@phdru.name>, Python Mailing List <python-list@python.org>"
271
272 send-hook ~u unmy_hdr Reply-To
273
274 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
275 #
276 # Key bindings
277 #
278
279 # Change Up/Down for pager
280 bind pager <Up> previous-line
281 bind pager <Down> next-line
282
283 bind index,pager <Esc>c copy-message
284 bind index,pager <Esc>S decode-save
285
286 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
287 #
288 # Macros
289 #
290
291 macro index C \
292    <Home><change-folder><Enter> \
293    "Go to the first folder with unread messages"
294 macro pager,attach C \
295    <exit><Home><change-folder><Enter> \
296    "Go to the first folder with unread messages"
297
298 macro index,pager S \
299    <save-message>!<Enter> \
300    "Move current message to inbox"
301
302 macro index,pager <Esc>h \
303    ":auto_view text/html<Enter>" \
304    "View HTML attachments"
305 macro index,pager <Esc>H \
306    ":unauto_view text/html<Enter>" \
307    "Don't show HTML attachments"
308
309 macro index <Esc>s \
310    "<pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
311    "Send spam to SpamCop"
312 macro pager <Esc>s \
313    "<exit><pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
314    "Send spam to SpamCop"
315 macro index <Esc>z \
316    ":set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
317    "Process message from SpamCop"
318 macro pager <Esc>z \
319    "<exit>:set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
320    "Process message from SpamCop"
321
322 macro index H \
323    <Home><change-folder>!<Enter> \
324    "Go to inbox"
325 macro pager,attach H \
326    <exit><Home><change-folder>!<Enter> \
327    "Go to inbox"
328 macro index M \
329    <Home><change-folder>=sent-mail<Enter> \
330    "Go to sent-mail"
331 macro pager,attach M \
332    <exit><Home><change-folder>=sent-mail<Enter> \
333    "Go to sent-mail"
334
335 # Go to python mailbox
336 macro index Y \
337    <Home><change-folder>=lists/python<Enter> \
338    "Go to python"
339 macro pager,attach Y \
340    <exit><Home><change-folder>=lists/python<Enter> \
341    "Go to python"
342
343 # Go to STCnet "Atlas"/STM mailboxes
344 macro index A \
345    <Home><change-folder>=stcnet<Enter> \
346    "Go to stcnet inbox"
347 macro pager,attach A \
348    <exit><Home><change-folder>=stcnet<Enter> \
349    "Go to stcnet inbox"
350 macro index <Esc>a \
351    <Home><change-folder>=sent-stcnet<Enter> \
352    "Go to sent-stcnet"
353 macro pager,attach <Esc>a \
354    <exit><Home><change-folder>=sent-stcnet<Enter> \
355    "Go to sent-stcnet"
356
357 # Recode base64 to 8bit, html to plain text, mustdie-1251 to koi8-r, etc.
358 macro index,pager \
359    <Esc>m "<pipe-message>mimedecode.py | less<Enter>" \
360    "View MIME-decoded message"
361 macro index,pager E \
362    ":set editor=mimedecode.sh<Enter><edit>:set editor=vim.sh<Enter>" \
363    "MIME-decode and save"
364
365 macro index,pager <Esc>f \
366    <pipe-message>~/mail/bin/view-x-face<Enter> \
367    "Convert X-Face header to an image and display it"
368
369 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
370 #
371 # Colors
372 #
373
374 # This is for an xterm with with grayish background
375
376 #     object      foreground     background regexp/pattern
377
378 color normal      default        default
379 color hdrdefault  black          default
380
381 color header      magenta        default ^(date|x-mailer|user-agent|x-operating-system):
382 color header      blue           default ^(from|to|cc|delivered-to|reply-to|mail-followup-to|x-attribution):
383 color header      brightblack    default ^subject:
384
385 color quoted      blue           default
386 color quoted1     magenta        default
387 color quoted2     red            default
388 color quoted3     green          default
389 color quoted4     cyan           default
390 color quoted5     blue           default
391 color quoted6     magenta        default
392 color quoted7     red            default
393 color quoted8     green          default
394 color quoted9     cyan           default
395 color quoted10    blue           default
396
397 color attachment  white          green
398 color error       brightred      default
399 color index       brightblack    default ~N
400 color indicator   black          cyan
401 color message     blue           default
402 color search      black          yellow
403 color signature   magenta        default
404 color status      white          blue
405 color underline   blue           default
406
407 color markers     brightblue     default
408 color tilde       blue           default
409 color tree        blue           default
410
411 # email
412 color body        brightmagenta  default [-a-Z_0-9.+]+@[-a-Z_0-9.]+
413
414 # URLs
415 color body        brightblue     default "(((https?|ftp|gopher|telnet)://|(mailto|file|news|about|ed2k|irc|sip|magnet):)[^' \t<>\"]+)[A-Za-z0-9/]"
416
417 # Smilies (emoticons)
418 color body        brightmagenta  default " [;:]-*[dp(){}<>|\\/]| [(){}<>|\\/]-*[;:]" # :-)
419
420 # Attributes when using a mono terminal
421 mono header underline ^Subject:
422 mono quoted bold