ambevar-dotfiles/.mutt/muttrc

260 lines
8.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

## Mutt Configuration
## This configuration is made for Mutt with embedded IMAP support.
## These folders are assumed to exist:
## ~/.mutt.d: personal stuff (contacts, account information).
## ~/.mutt: public stuff (config, theme, mailcap).
## ~/.cache/mutt: cache for headers and messages.
################################################################################
## General options.
## Beep on new incoming mails.
set beep_new=yes
## PGP options.
set crypt_replyencrypt=yes
set crypt_replysign=yes
set crypt_replysignencrypted=yes
set crypt_use_gpgme=yes
set pgp_timeout=3600
## Headers are editable in editor.
set edit_headers=yes
## Set EDITOR dynamically.
source "~/.mutt/maileditor.sh|"
## Don't ask for recipient. We usually don't want to include mail unless we want
## to quote it.
set fast_reply=yes
set include=ask-no
set include_onlyfirst=yes
## 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/headers
set message_cachedir=~/.cache/mutt/messages
source "~/.mutt/purgecache.sh '$message_cachedir'|"
## Tell Mutt to check all IMAP folders. This will add all of them to the sidebar
## (if used). Contrary to the 'mailboxes' menu, sorting 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=30
## Allow mutt to open new imap connection automatically.
unset imap_passive
## How often to check for new mail (time in seconds).
set mail_check=60
## Mailcap
set mailcap_path=~/.mutt/mailcap
auto_view text/html
alternative_order text/plain text/html
## Mailbox type.
set mbox_type=Maildir
## Forward attachment as well.
set mime_forward=yes
set mime_forward_rest=yes
## Keep showing the list of mails while in pager.
set pager_index_lines=8
## Show context lines when going to next page and stop at the end instead of
## displaying next mail.
# set menu_context=3
set pager_context=3
set pager_stop=yes
## Encoding.
set rfc2047_parameters=yes
set send_charset="us-ascii:utf-8"
## Remove delay between mailbox switches.
set sleep_time=0
## Group mail into conversations, sort by last mail from conversation.
set sort=threads
set sort_aux=last-date-received
set strict_threads=yes
################################################################################
## Multiple accounts
## Store passwords as follows in .mutt.pwds:
# set my_pw_personal = foo
# set my_pw_work = foo
##
## CCRYPT:
## $ ccencrypt .mutt.pwds
##
## GNUPG: Generate a key pair with:
## $ gpg2 --gen-key
## Encrypt them with:
## $ gpg2 -e -r <user> ".mutt.pwds"
## 'accountrc' should contain the following config:
## Fetch passwords
# source "ccat ~/.mutt.pwds.cpt |"
## Or
# source "gpg2 -dq ~/.mutt.pwds.gpg |"
##
## Source accounts. Default account is last.
# source "~/.mutt.d/personal"
# folder-hook $folder 'source ~/.mutt.d/personal'
# source "~/.mutt.d/work"
# folder-hook $folder 'source ~/.mutt.d/work'
##
## You can add an optional binding to switch mailboxes:
# macro index,pager <f2> '<enter-command>source ~/.mutt.d/personal<enter><change-folder>!<enter>'
# macro index,pager <f3> '<enter-command>source ~/.mutt.d/work<enter><change-folder>!<enter>'
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 version.
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
################################################################################
## Key bindings.
## 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
## Always reply to group.
bind index,pager r group-reply
## 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
## Remove N/O flag in one key stroke.
macro index <Esc>n '<clear-flag>N'
## Vi/Emacs bindings.
bind pager j next-line
bind pager k previous-line
bind attach,index,pager \CD next-page
bind attach,index,pager \CU previous-page
bind attach,index,pager ? search-reverse
bind attach,index,pager h help
bind attach,index,pager \Ch display-toggle-weed
bind attach,index,pager N search-opposite
bind index <Esc>x collapse-thread
bind index <Esc>X collapse-all
bind attach,index,pager \CV next-page
bind attach,index,pager <Esc>v previous-page
bind pager g top
bind pager G bottom
bind pager <Esc>< top
bind pager <Esc>> bottom
bind attach,index g first-entry
bind attach,index G last-entry
bind attach,index <Esc>< first-entry
bind attach,index <Esc>> last-entry
################################################################################
## Custom header 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.
################################################################################
## Theme.
## 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"
set my_index_format_pre='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}'
set my_index_format_post=' (%-4.4c) %?M?<%M> ?%-$my_col_subject.${my_col_subject}s"'
folder-hook .*[sS]ent.* "$my_index_format_pre"t"$my_index_format_post"
folder-hook ! .*[sS]ent.* "$my_index_format_pre"F"$my_index_format_post"
## Original status_format, with dash line removed.
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) "
## This will redraw screen and justify the index.
macro index,pager \CL "<enter-command>$my_index_format_pre"F"$my_index_format_post<enter><redraw-screen>"
## Set color variables from a theme.
# source "~/.mutt/colors.classic"
source "~/.mutt/colors.zenburn"
## Fallback for terminals without 256 colors. This needs to be a shell script so
## that it can check for terminal capabilities.
source "~/.mutt/colors.fallback.sh |"
## Apply theme.
source "~/.mutt/theme"
################################################################################
## Sidebar.
## We use a script to test if sidebar is installed. Needs to be loaded _after_
## the theme.
source "~/.mutt/sidebar.sh|"