summaryrefslogtreecommitdiff
path: root/archive/.config/mutt/muttrc
blob: 4481d27216a338e88d10a4c7f792f8d0b4e72ead (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
# 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

# reply-hook . 'set from="Sean Whitton <spw@sdf.org>" use_from'
# reply-hook "~f arizona.edu" 'set from="Sean Whitton <spwhitton@arizona.edu>" use_from'
# reply-hook "~t spwhitton@arizona.edu" 'set from="Sean Whitton <spwhitton@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@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@arizona.edu ^%C cmrecps" 'push <edit-from><home><kill-eol>Sean\ Whitton\ <spwhitton@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'

# 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"

#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

# filtering function keys, some from Jess
# 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>"

# # 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

# # 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

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