Mutt settings (.muttrc)

Most of these settings are tested with Mutt 1.4 (specifically, 1.4.2.3 as included in Owl at the time of this writing):

# Make Mutt use us-ascii when the content is all 7-bit, otherwise use koi8-r
set charset="koi8-r"
set send_charset="us-ascii:koi8-r"

# When viewing and replying to messages that use windows-1251, make Mutt recode
# them to koi8-r
charset-hook windows-1251 cp1251

# Mutt will save received & sent messages here
set mbox="~/Mail/received"
set record="~/Mail/sent"

# Disable sorting
set sort=mailbox-order

# Set the desired default "from" address for both header From and envelope-from
set from="you@openwall.com"
set hostname="openwall.com"
set envelope_from=yes
set use_domain=no

# Recognize these as own addresses for displaying +/T/C marks on messages, as
# well as for the reverse_name setting
set alternates="you@openwall.com|regexps-for-your-other-addresses-may-go-here"

# When replying to or forwarding a message sent to a recognized own address
# (see above), reuse the same full name and address that the message was
# addressed to as the new "from" address
set reverse_name=yes

# Maybe use ~/tmp instead of /tmp - useful when /tmp is on tmpfs, to not lose
# edits on power failure
#set tmpdir="tmp"

# Decode and/or decrypt messages when searching (much slower and prompts for
# passphrase on first encrypted message encountered)
#set thorough_search="yes"

# Use this when "ispell" is actually the "aspell" wrapper (press "i" to invoke)
set ispell="ispell --mode=email"

# By default, Mutt adds the original sender's address to Subject on forwards,
# which we usually don't want
set forward_format="Fwd: %s"

# Don't display these headers by default (press "h" to display full headers)
ignore Delivered-To X-Delivery-ID X-Priority X-MSMail-Priority X-MimeOLE X-Spam-Checker-Version X-Spam-Level X-Spam-Status Precedence X-No-Archive List- DomainKey-Signature In-Reply-To User-Agent DKIM-Signature X-Google-Sender-Auth

# Highlight the obfuscated e-mail addresses in our RPM %changelogs, etc.
color body brightcyan default "<[-a-z_0-9.+]+[- ]at[- ][-a-z_0-9.]+>"

# If you're using a local SpamAssassin bayes database, you might want to bind a
# key, such as Shift-S on the index, to invoke sa-learn and mark messages as
# deleted.
#macro index S "| sa-learn --spam --no-sync --single\n<delete-message>" "spam learn"

# ...append /usr/share/doc/mutt-1.4*/gpg.rc to here

The following additions were taken from (GalaxyMaster)'s .muttrc:

# Use a wrapper script around an editor to do some checks after editing a message.
# Currently the mail-editor script contains two lines:
# vim -c 'set ft=mail' "$1"
# aspell -e -c "$1"
# The first line invokes vim and enforces the e-mail filetype (this allows to apply
# the auto-indentation to the message, yet the quoted text will be untouched).
# The second line calls the spell checker which will skip quoted portions of the
# message.
set editor = "~/bin/mail-editor"

# Use aspell directly, not via its ispell wrapper
set ispell="aspell -c --mode=email"

# Save one line of the context during scrolling
set pager_context = 1

# Show 6 lines of message subjects above the message you read
set pager_index_lines = 6

# Stop at the end of the message, do not jump to the next message
set pager_stop = yes

# update the message counter every 1000 messages (helps to speed the starting time
# up on a slow link, e.g. over GPRS)
set read_inc = "1000"

# ditto for the write counter (e.g. on exit)
set write_inc = 1000

# unbind x so there will be no chance to exit mutt incidentally
bind index x noop

# use Tab to jump to the next unread message and ,+Tab to jump to the previous unread
# message.  I find it more usable than the default, which is to jump to the next
# new message.
bind index \t next-unread
bind pager \t next-unread
bind index ,\t previous-unread
bind pager ,\t previous-unread

# a small helper to present user with a selection of names/addresses to use in
# the From field.  It's bound to the 'v' key.  The get_my_ids script is a one-liner:
# cat -b ~/.mutt/identities | sed 's,^[[:space:]]*\([[:digit:]]\),alias _id_\1,g'
# It's possible to squeeze it into .muttrc, but it was easier to create an
# external file and put the complex command there.  The identities file has the
# same format as aliases, i.e. "email@domain.tld (FirstName LastName)").
macro compose v "<enter-command>source '~/.mutt/bin/get_my_ids|'<enter><edit-from>^U_id_<tab>" "Select from"

As an alternative or in addition to manual From address selection, the following settings may be used (from Solar's .muttrc, with minor changes not to reveal the specific addresses on this public wiki page):

send-hook . 'unmy_hdr From:'
send-hook ~Ctech@client1 'my_hdr from: "First Last" <me@client1.com>'
send-hook 'client2|client3' 'my_hdr from: "First Last" <me@openwall.com>'
send-hook ~tfriend@somewhere 'my_hdr from: "First Last" <me-personal@openwall.com>'

The ”~Ctech@client1” line is triggered whenever the client company's sysadmin team address is in To or CC, which it should be when e-mailing customers/clients of that client company (we represent that company rather than Openwall when we do so). The “client2|client3” line is triggered when the domain name of one of these clients is found on one of the destination addresses (we represent Openwall when we contact them).

.vimrc

We commonly use the VIM text editor along with Mutt. Please refer to the page on .vimrc settings, which describes some of those relevant to editing e-mail messages.

internal/email/muttrc.txt · Last modified: 2010/08/18 14:27 by solar
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate to DokuWiki Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki Powered by OpenVZ Powered by Openwall GNU/*/Linux