On Tue, Dec 07, 2010 at 07:18:04PM -0500, Dan Ritter wrote: > Given that I have this working nicely: > set record="~/Mail/archive/sent-`date +%Y-%m`" > > I'm sure that you could do a similar thing in a save-hook. If > you want annual rather than YYYY-MM, just make it `date +%Y`
This works: set mbox="+Archives/`date +%Y`" save-hook . $mbox Now I can use mutt's standard save-message command to save message(s) to archive folders, instead of needing my own macro. It's more key presses than the macro because mutt asks for confirmation twice, but it's more reassuring because it looks different from deleting a message. Seems more like the mutt way to do it. But this still saves each message to an archive folder based on the current year when mutt was started, rather than on the year of the message. You can't define a save-hook based on the year of the message because there isn't an expando for that, only for the full date. I think it would require an external script, as suggested.