]> git.phdru.name Git - dotfiles.git/blob - .muttrc
Initial import
[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 \
161    mlug@unixcenter\.ru
162
163 #lists
164
165 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
166 #
167 # Change settings based on mailbox
168 #
169 #       folder-hook [!]<regexp> <command>
170 #
171 # <command> is executed when opening a mailbox matching <pattern>
172
173 # Restore defaults
174 folder-hook .* "\
175    my_hdr From: Oleg Broytman <phd@phdru.name>; \
176    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
177    my_hdr X-Url: http://phdru.name/; \
178    set attribution='On %d, %f wrote:'; \
179    set record==sent-mail; \
180    set signature==signatures/phd@phdru.name"
181
182 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
183 #
184 # Multiple spool mailboxes
185 #
186 #       mbox-hook [!]<pattern> <mbox-mailbox>
187 #
188 # Read mail in <pattern> is moved to <mbox-mailbox> when <pattern> is closed.
189
190 #mbox-hook =mutt-users.in =mutt-users
191 #mbox-hook +TEST +inbox
192
193 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
194 #
195 # Specify default filename when saving messages
196 #
197 #       save-hook [!]<pattern> <mailbox>
198 #
199 # <mailbox> is provided as default when saving messages from <pattern>
200
201 #save-hook mutt- =mutt-mail
202 #save-hook aol\.com +spam
203
204 save-hook .* =inbox
205
206 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
207 #
208 # Specify where to save composed messages
209 #
210 #       fcc-hook [!]<pattern> <mailbox>
211 #
212 # <pattern> is recipient(s), <mailbox> is where to save a copy
213
214 #fcc-hook joe +joe
215 #fcc-hook bob +bob
216
217 #fcc-hook .* +sent
218
219 fcc-hook .* =sent-mail
220
221 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
222 #
223 # Change settings based upon message recipient
224 #
225 #       send-hook [!]<pattern> <command>
226 #
227 # <command> is executed when sending mail to an address matching <pattern>
228
229 #send-hook mutt- 'set signature=~/.sigmutt; my_hdr From: Mutt User <user@example.com>'
230
231 # Restore defaults
232 send-hook .* "\
233    my_hdr From: Oleg Broytman <phd@phdru.name>; \
234    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
235    my_hdr X-Url: http://phdru.name/; \
236    set attribution='On %d, %f wrote:'; \
237    set signature==signatures/phd@phdru.name"
238
239 send-hook "~L '@.*\.(r|s)u$'" "\
240    my_hdr From: Олег Бройтман <phd@phdru.name>; \
241    my_hdr Reply-To: Олег Бройтман <phd@phdru.name>; \
242    set attribution='В %{%a, %d %b %Y в %I:%M:%S%p %Z} %f написал:'; \
243    set signature==signatures/phd@phdru.name-ru"
244
245 send-hook "~L '@(mail|list|inbox|bk)\.ru'" "\
246    my_hdr From: Олег Бройтман <phd@mail.ru>; \
247    my_hdr Reply-To: Олег Бройтман <phd@mail.ru>; \
248    my_hdr X-Url: http://my.mail.ru/mail/phd; \
249    set signature==signatures/phd@mail.ru"
250
251 send-hook "~L '(@|\.)(((ya|yandex|narod)\.ru)|(yandex\.com)|yandex-team\.ru)$'" "\
252    my_hdr From: Олег Бройтман <phd2@yandex.ru>; \
253    my_hdr Reply-To: Олег Бройтман <phd2@yandex.ru>; \
254    my_hdr X-Url: http://phd2.ya.ru/; \
255    set signature==signatures/phd2@yandex.ru"
256
257 send-hook ~u unmy_hdr Reply-To
258
259 send-hook "~L python-announce-list@python\.org" "\
260    set followup_to=no; \
261    my_hdr Reply-To: python-list@python.org; \
262    my_hdr Mail-Followup-To: phd@phdru.name, python-list@python.org"
263
264 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
265 #
266 # Key bindings
267 #
268
269 # Change Up/Down for pager
270 bind pager <Up> previous-line
271 bind pager <Down> next-line
272
273 bind index,pager <Esc>c copy-message
274 bind index,pager <Esc>S decode-save
275
276 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
277 #
278 # Macros
279 #
280
281 # Go to the first folder with unread messages
282 macro index C  <Home>c\n
283 macro pager C q<Home>c\n
284
285 # Move current message to inbox
286 macro index,pager S s!\n
287
288 macro index,pager <Esc>h ":auto_view text/html\n"
289 macro index,pager <Esc>H ":unauto_view text/html\n"
290
291 # Pipe spam
292 #macro index,pager z |"sa-learn --no-sync --ham\n"
293 #macro index,pager Z |"sa-learn --no-sync --spam\n"
294 macro index,pager <Esc>s "<Enter>q"|"spamassassin -d | ~/mail/bin/spamcop.py\nj"
295 macro index,pager <Esc>z "<Enter>q:set editor='vim -s ~/mail/misc/spamcop.vim'\nr:set editor=vim.sh\nqn"
296
297 # Go to main mailbox
298 macro index H  <Home>c!\n
299 macro pager H q<Home>c!\n
300
301 # Go to python mailbox
302 macro index Y  <Home>c=lists/python\n
303 macro pager Y q<Home>c=lists/python\n
304
305 # Recode base64 to 8bit, html to plain text, mustdie-1251 to koi8-r, etc.
306 macro index,pager M "|mimedecode.py | less\n"
307 macro index,pager E ":set editor=mimedecode.sh\ne:set editor=vim.sh\n"
308
309 # Convert X-Face header to an image and display it
310 macro index,pager <Esc>f |"~/mail/bin/view-x-face\n"
311
312 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
313 #
314 # Colors
315 #
316
317 # This is for an xterm with with grayish background
318
319 #     object      foreground     background regexp/pattern
320
321 color normal      default        default
322 color hdrdefault  black          default
323
324 color header      magenta        default ^(date|x-mailer|user-agent|x-operating-system):
325 color header      blue           default ^(from|to|cc|delivered-to|reply-to|mail-followup-to|x-attribution):
326 color header      brightblack    default ^subject:
327
328 color quoted      blue           default
329 color quoted1     magenta        default
330 color quoted2     red            default
331 color quoted3     green          default
332 color quoted4     cyan           default
333 color quoted5     blue           default
334 color quoted6     magenta        default
335 color quoted7     red            default
336 color quoted8     green          default
337 color quoted9     cyan           default
338 color quoted10    blue           default
339
340 color attachment  white          green
341 color error       brightred      default
342 color index       brightblack    default ~N
343 color indicator   black          cyan
344 color message     blue           default
345 color search      black          yellow
346 color signature   magenta        default
347 color status      white          blue
348 color underline   blue           default
349
350 color markers     brightblue     default
351 color tilde       blue           default
352 color tree        blue           default
353
354 # email
355 color body        brightblue     default [-a-Z_0-9.+]+@[-a-Z_0-9.]+
356
357 # URLs
358 color body        brightblue     default "(((https?|ftp|gopher|telnet)://|(mailto|file|news|about|ed2k|irc|sip|magnet):)[^' \t<>\"]+)[A-Za-z0-9/]"
359
360 # Smilies (emoticons)
361 color body        brightmagenta  default " [;:]-*[dp(){}<>|\\/]| [(){}<>|\\/]-*[;:]" # :-)
362
363 # Attributes when using a mono terminal
364 mono header underline ^Subject:
365 mono quoted bold
366
367 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
368 #
369 # Encryption: GnuPG
370 #
371 source /usr/share/doc/mutt/examples/gpg.rc
372 set pgp_use_gpg_agent