Arnold S. Ferrer writes:
> How do I filter email using mutt (Mutt 1.0i)? To have mutt
> take any message with a subject pattern and have it move the mail
> from the imap server to my local folder, say junk or something.
>
> Specifically, the pattern of the Subject field is:
>
> RNA000000nnnnnn new ticket for SCH Help Center
>
> Where nnnnnn are six digits that change all the time.
>
> Some form of a hook???
Ideally, mail should be filtered before mutt gets to see it. Ie. by
using fetchmail+procmail to d/l mail from the server and filter it
into separate mailboxes.
If I were to do this manually, I would tag-pattern (default 'T') the
messages and tag-save (;s) them into a save-hook specified location.
(This can probaby be put into a macro).
No need to tag if there's only one, in which case they can be saved
straight away.
The save-hook for your case would be something like
save-hook '~s ^RNA000000' +junk
or
save-hook '~s ^RNA0{6}[0-9]{6} new ticket for SCH Help Center' +junk
or
save-hook '~s RNA000000' +junk
or
save-hook '~s RNA0{6}[0-9]{6} new ticket for SCH Help Center' +junk
The first two don't match replies (Subject: Re: RNA....). The 2nd and 4th
prevent a match on "Subject: RNA000000 hello world" etc. The fuzziness of
the match is up to you :)