Speedy and efficient email use with Gnus and Emacs
- 1.1 What can be done?
- 1.1.1 Filtering
- 1.2 More filtering
- 1.3 The golden bullet
Out of the box Gnus might not be too bad speed-wise, but once you’ve added the odd tweak (or 50) you’ll notice it taking a few seconds to open a buffer of, say, 400 threaded emails. For me that’s bare-able but I can see why others might become frustrated (especially coming from Mutt for instance). Below are some tips on how to make things much easier when dealing with a lot of mail.
1.1 What can be done?
1.1.1 Filtering
There are a few things that help, the obvious one is to make sure you filter (or split as gnus calls it) mail into appropriate groups. I favour pulling mail from my IMAP account with fetchmail and then letting it through procmail with slightly modified rules I stole from here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
:0 * ^X-Mailing-List:[ ]<\/[^ >`']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ :0 * ^X-Mailing-List:[ ]\/[^ `']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ :0 * ^Sender:[ ]owner-\/[^ `']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ :0 * ^X-BeenThere:[ ]\/[^ `']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ :0 * ^Delivered-To:[ ]mailing list \/[^ `']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ :0 * ^X-Loop:[ ]\/[^ `']+ lists/`echo $MATCH | sed -e 's/[\/]/-/g' | tr A-Z a-z`-`date +%Y-%m`/ |
This does what it can to find out which mailing list the mail is a member of and filters it to an appropriately named maildir for example; anything in emacs-devel@gnu.org goes to ~/.mailspool/emacs-devel@gnu.org-2009-02/
1.2 More filtering
As you see I put the month and the year on the end of the folder (I do this for my inbox too) so that I don’t ever have to clear out boxes. In the case of emacs-devel I got 995 emails last month, I would bet after six months trying to browse through that folder would be horrible.
I should point out that this is all possible from within Gnus itself thanks to splitting.
1.3 The golden bullet
Fast and powerful searching using nnmairix is absolutely indispensable to me, especially at work where I find the need to refer to a previous conversation much more often than at home. Even if I’m after a recent mail that might be at the top of the summary buffer I find myself searching for it.
The tool powering these searches is called mairix and promotes the following functionality:
- Fast searching:
- I guess this is what I’ve been banging on about.
- Powerful searching:
- Loads of options for things like searching specific headers (by default words in the body are searched), fancy date range operators, return all nodes of a thread in which one of the nodes hit and lots other handy things.
- Good intergration:
- Mairix creates a maildir (it also supports MH or mbox) and populates it with symbolic links to hits. nnmairix takes care of maintaining the groups within Gnus.
- Search folders:
- You can have live searches which allows you to have folders that fill up with hits as they come in. For example you could have a folder called offers where all mails containing the string “penis enlargement” will be linked to.
blog comments powered by Disqus