Elric's random thoughts in idle times

"Why stop now, when I'm just starting to hate it?" – Marvin the robot

muttrc

with 2 comments

Mutt has a pretty astonishing set of features you can configure. The document in /usr/share/doc/mutt/manual.txt.gz is a COMPREHENSIVE guide that lists all the diferent settings that Mutt can take.

The configuration file for Mutt is ~/.muttrc. Since it can become pretty large and a mess to edit, it may be useful to split it into smaller files, and make Mutt source these files from .muttrc. For example, by typing the following line in your .muttrc:

source $HOME/.mutt/maillists

Besides .muttrc, the sourced files can have any name or location.
This is a simplified version of my .muttrc. Thanks to all the bits and pieces I took from others.


# Mailbox Config
set mbox_type=Maildir
set hostname=gmail.com
#set mbox="~/mail/inbox"
set spoolfile="$HOME/.mail/GMAIL/INBOX"
set folder="$HOME/.mail/GMAIL"
set postponed="$HOME/.mail/GMAIL/[Google Mail].Drafts"
set record="$HOME/.mail/GMAIL/[Google Mail].Sent Mail"
set trash="$HOME/.mail/GMAIL/[Google Mail].Bin"
unset move # gmail does that
# The information you want in the from field.
set realname = "xxxxxxxxxxxxx"
set from = "xxxxxxxxx@gmail.com"
set use_from = yes
set signature=~/.mutt/signature

# Mailboxes
source $HOME/.mutt/muttrc.mailboxes

If your gmail server sends you foldernames with spaces, you may need to specify it in .muttrc
as the folder may become “invisible” to Mutt, and any changes that you may perform in the mailboxes file will get overridden, and modified by offlineimap.
See the tips page.
There is also the nametrans option in offlineimap to sort this out. See the man page.

# MTA to use.
set sendmail="/usr/sbin/ssmtp"# Editor. You can choose any.
set editor="gvim -f -c '+/^$'" # For a better integration, see mutt tips.

# Alias/address book ######
set alias_file=~/.mutt/mutt-alias
source ~/.mutt/mutt-alias
set sort_alias=alias

# headers to show
ignore * # ignore all headers
unignore From: To: CC: Date: Subject: X-mailer: User-Agent: # show only these
hdr_order From: To: CC: Date: Subject: X-mailer: User-Agent: # and in this order
set forward_format = "Fwd: %s" # format for subject when forwarding
set edit_headers
alternative_order text/enriched text/plain text/html # What mutt chosses first to show.
auto_view text/html # Configuration in .mailcap. Show html, use w3m to parse it (w3m is installed by default on Debian).

set abort_nosubject=yes # Cancel a message when subject is blank
set postpone=ask-yes # Asks to postpone a message when not sent
set include=yes # Automatically quote message in reply
#set mark_old=no # Don't mark unread as old
set sort=threads # View your mail by threads, not strict date.
set mail_check=30 # Checkout your folders every 30s when active,
set timeout=60 # and timeout for idle. (Rough explanation).

# Mail Cache. Speeds up large folders
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set message_cache_clean=yes

######################################
# Source external config files

source $HOME/.mutt/muttrc.mailboxes
source $HOME/.mutt/maillists
source $HOME/.mutt/color
source $HOME/.mutt/macro_bin
######################################

If you specify the maillist you are suscribed to with the form subscribe mutt-users, you will gain some features. See the manual for more information.

Back to main.

Written by elric80

November 21, 2009 at 4:29 pm

2 Responses

Subscribe to comments with RSS.

  1. I’m assuming

    > $HOME/~mutt/muttrc.mailboxes

    Should be

    > $HOME/.mutt/muttrc.mailboxes

    Stephen

    January 1, 2012 at 10:20 pm

    • Indeed……. Thanks!

      elric80

      January 1, 2012 at 11:31 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: