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