next up previous contents
Next: Downloading Mail: Fetchmail Up: Other Mail Folders Previous: Your Sent Mail box   Contents

IMAP Trick: Header Caching

IMAP is useful in countless ways, but mutt has one disadvantage: every time you enter a new IMAP folder Mutt has to reread the contents of the entire folder in order to present you with the index. For folders with a lot of messages, or any folder if you're working over a slow connection, that can be the source of a very lengthy pause. Caching the headers takes care of the problem, by providing mutt with a mechanism for storing the headers (To, From, Date, Subject, etc.) locally; mutt then only needs to compare the contents of your IMAP folder with the local cache, and react accordingly. For most IMAP users, this is a huge improvement. To make use of header caching, first create a folder for mutt to use; I called mine .mutt-headercache (creative, eh?). I made it a dot file so I wouldn't have to look at it every day in my home folder. Once you've created a home for the cache, simply tell mutt where to find it, as follows:

set header_cache=/home/randymon/.mutt-headercache

Note that header caching was originally a patch to mutt, that is, a non-standard feature you had to compile in yourself. Increasingly it's a standard feature. It came automatically with my SUSE 9.2 distro. You'll know you don't have it if, when starting up mutt, it gives you an error message as it parses your .muttrc. If that's the case you can only add this feature by recompiling mutt with the patch included, something that is way beyond the scope of this manual but surprisingly simple.


next up previous contents
Next: Downloading Mail: Fetchmail Up: Other Mail Folders Previous: Your Sent Mail box   Contents
Randall Wood 2008-03-05