I’m an email packrat. I usually archive every email I receive, and as a mutt user, tend to store them, by default, into whatever folder mutt assigns to them. This is fine for most emails from humans, or to recognised mailing lists, as it’ll generally do the right thing.
But I also get lots of emails from companies I shop from on-line, daily “info” lists that I’m on, ebay and half.com watchlist updates etc. In most of these cases I waste a lot of time having to override mutt’s defaults, as it usually wants to save to =info or =news or =updates or somesuch, rather than =amazon, or =ebay. Of course it never seems like a lot of time – it’s actually quite quick to type ‘s=ebay’. But it’s even quicker to type ‘s<return>’, and with the volume of email I get, that adds up.
I always had a niggling suspicion that there would be a better way, and today I finally got fed up enough to find out. The on-line manual is definitive, but mostly useless for finding answers to things like this. So instead I did what I usually do in cases like this – ask Marty. He introduced me to the wonderful concept of the save-hook.
Now I can create entries like:
save-hook '.*.ebay.co.uk' =ebay and have my ‘s<return>’ just Do The Right Thing.