Cross fingers, I might have this roughly right. Be gentle :)

On Fri, Sep 10, 1999 at 12:12:44AM +0200 or thereabouts, Marco Giardini wrote:
> I' desperately trying to better configure my mutt but I'm having problem 
> with the hooks. I need that all mail coming from BUGTRAQ and from some other
> mailing list is stored in a separate file than inbox.

You need procmail for this. Procmail will take the mail arriving on your
machine and sort it out for you according to recipes you put in your
.procmailrc. It will put it into folders. Mutt won't. Mutt will just
know to look in those folders once procmail has put it there.

You then tell mutt to look in those folders by telling it they exist
with the mailboxes line.

The save-hook for a folder tells mutt, "If I'm in this mailbox and I
hit save, I expect it to be saved to one called..."

> Let's suppose that mails from  gimp mailing list (containing gimp in the 
> from field) has to be stored in gimp (+gimp) and the mail from Bugtraq 
> into +bug.

I don't know the gimp mailing list address, but I have a .procmailrc
which sets a pile of local variables and then says:

:0:
* ^Sender:.*Bugtraq List
IN.bugtraq

_That's_ what puts it in the folder.

Then in my .muttrc I have

mailboxes /var/spool/mail/hobbit [load of others] IN.bugtraq [load more]
        (tells it to look there when checking for mail)
lists [loads here] IN.bugtraq [loads more]
        (tells it to handle it as a mailing list)
folder-hook . save-hook * =received
folder-hook [various IN.folders] save-hook * =folder
folder-hook IN.bugtraq save-hook * =bugtraq
        {tells it how to save things that were in those folders}

But those hooks only work once the mail's arrived there, and it's not
mutt that did that; that was procmail's job.

(Btw, I am told that those folder-hooks are not really the right way to
go about that, and that I should use the format you demonstrated :))

I hope this helps.

Telsa

Reply via email to