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