<<< Date Index >>>     <<< Thread Index >>>

Messing with message-hooks



Hi all,

I have a mutt configuration problem and I've reached the point where I
no longer have any idea whether what I'm trying to achieve is even
possible, so I am turning to the list for help.

My problem is this. There are a number of messages that, if they exhibit
certain characteristics, should always be saved to a certain folder. So
I figured I'd use a combination of message-hook and
save-hook for that, e.g. as follows:

  message-hook "~h foo | ~t fuu-me@mydomain" "save-hook ~A +foo-folder"

Works like a charm. 

Except that once I hit such a foo-message, the save-hook is installed
for all other messages as well, and so *everything* gets saved to
'foo-folder' from then on.

So I thought, Aha, this is analogous to what happens when you have a
folder-hook, and you need to do an explicit "folder-hook ." to get the
default behaviour back for your other folders.

   message-hook . "unhook save-hook"

Again, works like a charm. Only real foo-messages get saved to
foo-folder, the rest doesn't.

Unfortunately, it now seems no longer possible to specify *any* other
save-hook (e.g. one triggered by a folder-hook) -- the 'default'
message-hook trumps everything else, and my specification of e.g.:

  folder-hook bar-incoming "save-hook ~A +bar-folder ; mbox-hook
spam-incoming"

has no effect any more.

So, can anybody tell me if there's a more useful way of doing what I
want to do here?

Many thanks in advance,

-- 
Leo Breebaart  <leo@xxxxxxxxxx>