205 lines
7.3 KiB
Bash
205 lines
7.3 KiB
Bash
## -*- mode:sh -*- #
|
||
################################################################################
|
||
## Mutt Configuration
|
||
## Date 2013-09-21
|
||
################################################################################
|
||
|
||
## Note on folders:
|
||
## These folders are assumed to exist:
|
||
## ~/.mutt.d: personal stuff (contacts, account information).
|
||
## ~/.mutt: public stuff (theme, mailcap).
|
||
## ~/.cache/mutt: header cache.
|
||
|
||
##------------------------------------------------------------------------------
|
||
## General options
|
||
##------------------------------------------------------------------------------
|
||
|
||
## Beep on new incoming mails.
|
||
set beep_new = "yes"
|
||
|
||
## Headers are editable in editor.
|
||
set edit_headers=yes
|
||
|
||
## Set EDITOR dynamically.
|
||
source "~/.mutt/maileditor.sh|"
|
||
|
||
## Store message headers locally to speed things up. Gentoo wiki says that if a
|
||
## folder is specified, it is even faster. If no folder exists, the cache will
|
||
## be a single file.
|
||
set header_cache = "~/.cache/mutt"
|
||
|
||
## Tell Mutt to check all IMAP folders. This will add all of them to the
|
||
## sidebar. Contrary to the manu 'mailboxes' way, order cannot be controlled, so
|
||
## you should set 'sidebar_sort' to yes. This will sort the folders
|
||
## alphabetically, ignoring punctuation.
|
||
set imap_check_subscribed
|
||
|
||
## Keep imap connection alive by polling intermittently (time in seconds).
|
||
set imap_keepalive = 300
|
||
|
||
## Allow mutt to open new imap connection automatically.
|
||
unset imap_passive
|
||
|
||
## Mailcap
|
||
set mailcap_path = ~/.mutt/mailcap
|
||
auto_view text/html
|
||
alternative_order text/plain text/html
|
||
|
||
## How often to check for new mail (time in seconds).
|
||
set mail_check = 60
|
||
|
||
## Mailbox type.
|
||
set mbox_type=Maildir
|
||
|
||
## Keep showing the list of mails while in pager.
|
||
set pager_index_lines=8
|
||
|
||
## Encoding
|
||
set send_charset="us-ascii:utf-8"
|
||
|
||
## Remove delay between mailbox switches.
|
||
set sleep_time = 0
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Multiple accounts
|
||
##------------------------------------------------------------------------------
|
||
|
||
## accountrc should contain the following config:
|
||
|
||
## Set account names (arbitrary).
|
||
# set my_ac_personal=personal
|
||
# set my_ac_work=work
|
||
#
|
||
## Fetch passwords
|
||
# source "ccat ~/.mutt-pwds.cpt |"
|
||
## Or
|
||
# source "gpg2 -dq ~/.mutt-pwds.gpg |"
|
||
##
|
||
## Folder hooks, one per account.
|
||
# source "~/.mutt.d/$my_ac_personal"
|
||
# folder-hook $folder 'source ~/.mutt.d/$my_ac_personal'
|
||
# source "~/.mutt.d/$my_ac_work"
|
||
# folder-hook $folder 'source ~/.mutt.d/$my_ac_work'
|
||
##
|
||
## Optionnaly you can add shortcuts to switch mailboxes:
|
||
# macro index,pager <f2> '<enter-command>source ~/.mutt.d/$my_ac_personal<enter><change-folder>!<enter>'
|
||
# macro index,pager <f3> '<enter-command>source ~/.mutt.d/$my_ac_work<enter><change-folder>!<enter>'
|
||
|
||
## Store passwords as follows in .mutt-pwds:
|
||
# set my_pw_account = foo
|
||
##
|
||
## CCRYPT:
|
||
## $ ccencrypt .mutt-pwds
|
||
##
|
||
## GNUPG: Generate a key pair with:
|
||
## $ gpg2 --gen-key
|
||
## Encrypt them with:
|
||
## $ gpg2 -e -r <user> ".mutt-pwds"
|
||
|
||
source "~/.mutt.d/accountrc"
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Aliases
|
||
##------------------------------------------------------------------------------
|
||
|
||
## Mutt native support
|
||
# set alias_file = "~/.mutt.d/aliases"
|
||
# set sort_alias = alias
|
||
# set reverse_alias = yes
|
||
# source $alias_file
|
||
|
||
## Abook
|
||
## We redirect the error stream in case the config file in not compatible with
|
||
## current abook bersion.
|
||
set query_command= "abook --mutt-query '%s' 2>/dev/null"
|
||
macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook"
|
||
bind editor <Tab> complete-query
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Keys
|
||
##------------------------------------------------------------------------------
|
||
|
||
## Security issue: if enter-command is available from the GUI, it is possible to
|
||
## see the password unencrypted. We disable it for this reason. Every command
|
||
## that the user intends to use must be bound to a key in advance, otherwise it
|
||
## will never be accessible.
|
||
bind generic,alias,attach,browser,editor,index,compose,pager,pgp,postpone ':' noop
|
||
|
||
## HTML mail view with graphical Internet browser.
|
||
macro attach 'V' "<pipe-entry>cat >~/.cache/mutt/mutt-attach.mail && $BROWSER ~/.cache/mutt/mutt-attach.mail && rm ~/.cache/mutt/mutt-attach.mail<enter>"
|
||
|
||
## Remap bounce-message function to "B"
|
||
bind index B bounce-message
|
||
|
||
## Fix the 'change-dir' issue with multiple accounts. When change-dir was called
|
||
## with account A, then use switched to account B, change-dir will still point
|
||
## to account A by default.
|
||
# macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
|
||
|
||
## Manual fetch.
|
||
bind index "^" imap-fetch-mail
|
||
|
||
## Fix the backspace wrong binding that happens on some terminals.
|
||
#bind index,pager previous-page
|
||
|
||
## Fix Backspace -- Shell alternative.
|
||
## $ infocmp > termbs.src
|
||
## Changed kbs=^H to kbs=\177, then:
|
||
## $ tic -x termbs.src
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Custom headers for outgoing mail
|
||
##------------------------------------------------------------------------------
|
||
|
||
## Undo any custom headers that may have been put in by the global Muttrc
|
||
# unmy_hdr *
|
||
|
||
## Remove any global 'From:' header
|
||
# unset use_from
|
||
## Don't append a domain to my outgoing mails
|
||
# unset use_domain
|
||
# my_hdr From: Firstname Lastname <myfirstname@mymailserver>
|
||
|
||
## Extra info.
|
||
my_hdr X-Info: Simplicity is the ultimate sophistication.
|
||
|
||
## OS Info.
|
||
# my_hdr X-Operating-System: `uname -s`, kernel `uname -r`
|
||
|
||
## This header only appears to MS Outlook users
|
||
# my_hdr X-Message-Flag: WARNING!! Outlook sucks!
|
||
|
||
## Custom Mail-User-Agent ID.
|
||
set user_agent = yes
|
||
# my_hdr User-Agent: Every email client sucks, this one just sucks less.
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Themes
|
||
##------------------------------------------------------------------------------
|
||
|
||
## Index format
|
||
## We use my_col_* to get dynamic column size.
|
||
## See 'man 3 strftime' and 'man 3 printf'.
|
||
# set index_format="%?M?_%M_ ?%Z %2C %.13d (%-68.68F) %-68.68s %?M?_%M_&(%c/%l?"
|
||
set date_format="%y-%m-%d %T"
|
||
folder-hook .*[sS]ent.* 'set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}t (%-4.4c) %-$my_col_subject.${my_col_subject}s"'
|
||
folder-hook ! .*[sS]ent.* 'set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}F (%-4.4c) %-$my_col_subject.${my_col_subject}s"'
|
||
|
||
set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?] (%s/%S) %> (%P) "
|
||
|
||
## Colors
|
||
# source "/usr/share/doc/mutt/samples/colors.default"
|
||
# source "/usr/share/doc/mutt/samples/colors.linux"
|
||
# source "~/.mutt/colors.classic.sh|"
|
||
source "~/.mutt/colors.zenburn.sh|"
|
||
source "~/.mutt/colors.fallback.sh|"
|
||
source "~/.mutt/mutt.colors"
|
||
|
||
##------------------------------------------------------------------------------
|
||
## Sidebar
|
||
##------------------------------------------------------------------------------
|
||
|
||
## We use a script to test if sidebar is installed. Needs to be loaded _after_
|
||
## the theme.
|
||
source "~/.mutt/sidebar.sh|"
|