What's in your .muttrc?

user564376 picture user564376 · Feb 20, 2011 · Viewed 8k times · Source

I've just begun using mutt (what started out as slowly stripping myself of GUI applications, ended up with me just being holed inside a terminal window), and while I've managed to fetch my mail from my IMAP server, there are some customizations I'd like to do, mainly:

  1. Fetch today's mail.

  2. Leave everything on server

  3. Don't save anything ever on local disk

  4. Don't ask if I want to create a $USER/Mail folder. Since I also have my regular mail client, mutt is just an easy way to check mail from the terminal.

Instead of just asking a question here, I thought I'd try to find out more about some cool tricks, color scemes, and config settings you guys might have, that I can use in mine.

Answer

Cedric picture Cedric · Feb 20, 2011

Here's what I can think of re your customizations:

  1. Not sure how you'd be able to achieve that, if you switch to a folder in IMAP mutt will fetch all the headers of that folder. It will only fetch a mail once you open it tough.
  2. Since you are using IMAP, mutt should leave everything on the server by default anyway. It will only delete something if you specifically request deletion. Or maybe I'm misunderstanding what you're trying to achieve?
  3. That should be possible by disabling the local cache. There's a header and a message cache. See header-cache and message-cachedir for more info. But note that disabling the caches will hurt the performance, because every time you switch a directory mutt will have to re-fetch the headers for all your messages.
  4. In your muttrc, make sure to set your folder variable correctly. If I remember correctly $USER/Mail is the default value. If you set it correctly mutt won't ask you to create it every time you start it.

And here are some excerpts from my mutt config:

set postpone=ask-no 
set beep_new=yes
set confirmappend=no
set sort=threads
set mail_check=60
set timeout=10
set net_inc=5
set move=no
set sort_alias=alias
set reverse_alias=yes
set alias_file=~/.mail_aliases
set editor='vim + -c "set textwidth=72" -c "set wrap"'
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
auto_view text/html application/pdf application/msword
alternative_order text/plain text text/enriched text/html
mime_lookup application/octet-stream
source $alias_file
set mbox_type=maildir
set ssl_starttls=yes
set folder=imaps://host:port
set spoolfile="+inbox"
set record="+sent/`date +%Y-%m`"
set postponed="+drafts"
ignore *
unignore  Date To Cc Bcc From Subject X-Mailer Organization User-Agent X-PGP-Key List-Id
hdr_order Date From To Cc Bcc Subject X-Mailer User-Agent Organization List-Id X-PGP-Key

And my color scheme:

# Default color definitions
color normal     white         default
color hdrdefault green         default
color quoted     green         default
color quoted1    yellow        default
color quoted2    red           default
color signature  cyan          default
color indicator  brightyellow  red 
color error      brightred     default
color status     brightwhite   blue
color tree       brightmagenta default
color tilde      brightblue    default
color attachment brightyellow  magenta
color markers    brightred     default
color message    white         default
color search     brightwhite   magenta
color bold       brightyellow  green

# Color definitions when on a mono screen
mono bold      bold
mono underline underline
mono indicator reverse
mono error     bold

# Colors for items in the reader
color header brightyellow default "^(From|Subject):"
color header brightcyan   default ^To:
color header brightcyan   default ^Cc:
mono  header bold                 "^(From|Subject):"

Hope that helps!