summaryrefslogtreecommitdiff
path: root/.muttrc
blob: da33bed9709a94d476e3e6c724536505d81af7fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# -*- mode: conf; -*-

# --- preferences

set from=spwhitton@spwhitton.name
set realname="Sean Whitton"
set reverse_name = yes
set reverse_realname = no
set envelope_from = yes
set use_from = yes
set folder=~/.fmail/
set spoolfile = +inbox
set record = +sent
set postponed = +drafts
# set certificate_file = ~/.mutt/certificates
set move = no
set delete = ask-yes
#unset edit_hdrs
set edit_hdrs
set include
set reply_to
set abort_nosubject = no
# alternates '(spwhitton@spwhitton.name)|(spwhitton@email.arizona.edu)'
set hdr_format="%4C %Z %{%m/%d} %-15.15F (%4c) %s"
unset help
set mail_check=20
set timeout=15
set pager_index_lines=8
unset arrow_cursor
set fast_reply
set pager_context = 1
set reply_to = ask-yes
set pager_stop
set tmpdir="~/local/mutt"
set resolve = yes
set noconfirmappend
set abort_unmodified = no
set mark_old = no                  # better with mbsync
set editor = "emacsclient -t -a \"mg -n -f auto-fill-mode +8\""
set tilde
set smart_wrap
set wrap=80
unset markers
set wait_key=no

# use 'R' to recall, rather than asking to recall when we compose --
# this makes it less inconvenient to have multiple drafts queued
set recall = no

# --- CatMail hooks

# reply-hook . 'set from="Sean Whitton <spw@sdf.org>" use_from'
# reply-hook "~f arizona.edu" 'set from="Sean Whitton <spwhitton@email.arizona.edu>" use_from'
# reply-hook "~t spwhitton@email.arizona.edu" 'set from="Sean Whitton <spwhitton@email.arizona.edu>" use_from'

# send2-hook . 'set from="Sean Whitton <spw@sdf.org>" use_from'
# send2-hook "~t arizona.edu" 'set from="Sean Whitton <spwhitton@email.arizona.edu>" use_from'

# See <http://comments.gmane.org/gmane.mail.mutt.user/28818> on
# avoiding infinite loops with send2-hooks

# from hooks: use CatMail address for members of cmrecps group

group -group cmrecps -rx edu$ -rx ac.uk$

send2-hook "!~f spwhitton@email.arizona.edu ^%C cmrecps" 'push <edit-from><home><kill-eol>Sean\ Whitton\ <spwhitton@email.arizona.edu><enter>'

# PGP hooks: encrypt to members of the pgp_full group, do nothing for
# members of pgp_none, sign to everyone else

group -group pgp_none -rx arizona.edu$

send-hook "." "set crypt_autosign=no"
send-hook "." "set crypt_autoencrypt=no"
send-hook "!^%Cpgp_none" "set crypt_autosign=yes"
send-hook "^%Cpgp_full !^%Cpgp_none" "set crypt_autoencrypt=yes"

send-hook '!~g !~G ^%C pgp_full !^%C pgp_none' 'push <pgp-menu>b'
send-hook '!~g !^%C pgp_full !^%C pgp_none' 'push <pgp-menu>s'
send-hook '(~G|~g) ^%C pgp_none' 'push <pgp-menu>c'

# --- sorting

set sort = threads
set sort_browser = date
set sort_aux = last-date-received

# --- GPG settings

# can't use gpgme because some Debian services require inline PGP
# signatures, which gpgme doesn't support
set crypt_use_gpgme = no

# general preferences about signing and encrypting
set pgp_autosign = yes
set pgp_sign_as = 0x0F56D0553B6D411B
set pgp_replysign = yes
set pgp_replysignencrypted = yes
set pgp_replyencrypt = yes
set pgp_timeout = 120
set fcc_clear = no
# apparently unknown variable
#set pgp_encrypt_self = yes
set pgp_use_gpg_agent = yes
#set pgp_strict_enc

# redefine some settings from Debian's /etc/Muttrc.d/gpg.rc:

# additionally use Debian keyrings to verify sigs
set pgp_verify_command="gpg --keyring /usr/share/keyrings/debian-keyring.gpg --keyring /usr/share/keyrings/debian-maintainers.gpg --keyring /usr/share/keyrings/debian-nonupload.gpg --keyring /usr/share/keyrings/debian-role-keys.gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"

# absolutely ensure that encrypted messages are readable by me (this
# is probably unnecessary with NeoMutt thanks to pgp_encrypt_self above)
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg --use-agent --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x0F56D0553B6D411B -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --use-agent --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x0F56D0553B6D411B -- -r %r -- %f"

# --- message headers

hdr_order From: Date: x-oxford-username: Message-Id: To: Cc: Reply-To: Subject:
ignore *
unignore From: Date: x-oxford-username: Message-Id: To: Cc: Reply-To: Subject:

# --- mailboxes

mailboxes +inbox +sent +lists +haskell +spam +feeds

# --- message part viewing

auto_view text/html
alternative_order text/html text/plain text/enriched text
set mailcap_path = ~/.mutt/mailcap

# --- addresses

set alias_file=~/doc/mutt-aliases  # this is the main alias file
source ~/doc/mutt-aliases
source ~/doc/mutt-groups           # keep shortcut groups in a separate
                                   # file for simplicity
# --- key bindings

# filtering function keys, some from Jonathan
# macro index <F10> "l((~N|~O)!~D)<return><home>" "limit to mail to be processed"
# macro index <F9> "lall\n<end>" "limit to all mail"
# macro index,pager <F5> "c=inbox<return>" "switch to inbox"
# macro index,pager <F6> "c=sent<return>" "switch to sent"
bind index,pager <F7> next-unread-mailbox

# on startup, don't show new messages: distractions
# works when I type mutt into a terminal, but not if I use xmonad launcher shortcut...
# folder-hook inbox push "<limit>!~N!~O!~D<enter><last-entry>"

# quickly save attachments, woo
macro attach S "<save-entry><kill-line>~/tmp/<enter>y<enter>"

# # extract URLS--config from http://www.memoryhole.net/~kyle/extract_url/
# # the command to use these is Ctrl-J which picks the right one
# macro index,pager ,b "<enter-command> set my_pdsave=\$pipe_decode<enter>\
# <enter-command> unset pipe_decode<enter>\
# <pipe-message>extract_url.pl<enter>\
# <enter-command> set pipe_decode=\$my_pdsave<enter>" "get URLs"

# macro index,pager ,B "<enter-command> set my_pdsave=\$pipe_decode<enter>\
# <enter-command> set pipe_decode<enter>\
# <pipe-message>extract_url.pl<enter>\
# <enter-command> set pipe_decode=\$my_pdsave<enter>" "decrypt message, then get URLs"

# message-hook .  'macro index,pager \cj ,b "URL viewer"'
# message-hook ~G 'macro index,pager \cj ,B "URL viewer"'

# # quickly make a TODO item and flag so it doesn't get archived
# # macro index \co "!k|~/bin/capture-mail\nj"
# # macro pager \co "q!k|~/bin/capture-mail\nj"
# macro index \co "|~/bin/capture-mail\nj"
# macro pager \co "q|~/bin/capture-mail\nj"

# open RSS links in browser (fails because for some reason mutt can't bind <f{1--4}>
# macro index,pager <F4> "<pipe-message>grep '\^http' | sed 's/\^/-new-tab /' | xargs firefox<enter>" "open all URLs at beginning of lines in message in browser tabs"

# # open rss2email source link in browser
# # macro pager <f12> "<pipe-message>grep \"\^URL: http\" | xargs firefox -new-tab<enter>" "open rss2email source link"
# macro pager ,j "<pipe-message>egrep 'X-RSS-URL:' | cut -d' ' -f2- | xargs firefox -new-tab<enter>" "open rss2email source link"
# folder-hook feeds 'macro pager \cj ,j "URL viewer"'

# # train spam filter
# macro index,pager ,s "<enter-command>unset resolve<enter><clear-flag>N<enter-command>set resolve<enter><save-message>+spam<enter>" "mark as spam"

# easier scrolling
bind pager ] previous-page
bind pager [ next-page

# Emacs-style bindings
bind index n next-undeleted
bind pager n next-undeleted
bind index p previous-undeleted
bind pager p previous-undeleted
bind index ! flag-message
bind pager ! flag-message
bind pager t display-toggle-weed

# # printing
# bind index,pager \cP print-message

# # safety, since mbsync trash functionality doesn't work with FastMail
# bind generic,index,pager d noop
# bind generic,index,pager D noop
# bind generic,index,pager \cd noop

# # ... but let me delete notes made on tablet computer
# folder-hook . bind generic,index,pager d noop
# folder-hook "notes" bind index,pager d delete-message
# # ... and delete mistaken spam trains
# folder-hook "spam" bind index,pager d delete-message

# --- colours

# make flagged & new messages more obvious
color index brightred black "~F"
color index brightwhite black "~N|~O"

# --- mailing lists

# lists [0-9]+.*@bugs.debian.org
# subscribe debian-backports@lists.debian.org
# subscribe debian-devel@lists.debian.org

# --- mbsync

# macro generic,index,pager G "<sync-mailbox><shell-escape>mbsync fastmail<enter><sync-mailbox>"