[Techtalk] Help with procmail and $MATCH.

Val Henson val at nmt.edu
Sun Jan 13 15:28:11 EST 2002


On Sun, Jan 13, 2002 at 11:20:01AM +1100, Mary Gardiner wrote:
> 
> :0
> * ^TOlinuxchix
> {
>         :0:
>         * ^TO\/[A-Za-z]*
>         Tech/Linux/Linuxchix/$MATCH/
> 
>         :0:
>         Tech/Linux/Linuxchix/
> }

First, turn on verbose logging in your procmailrc:

LOGFILE=<logfilename>
VERBOSE=yes

While I didn't solve your exact problem, I did get the following
recipe to take any message with a subject beginning "Test" followed by
[A-Za-z]+ into a folder named by the subject.  For example, email with
subject Testblah created a folder named Testblah.

:0
* ^SUBJECT.*Test
{
        :0
        * ^SUBJECT[^A-Za-z]*\/[A-Za-z]+
        $MATCH

        :0
        Failed
}

You do need the "+" instead of the "*" or else MATCH="" (as the other
poster pointed out).  Looking through the logfile after each test will
tell you what's going wrong.  Be sure to turn verbose logging off
after you finish or your disk will fill up. :)

When you get the recipe working, post it for the rest of us, please?
I'll use it. :)

-VAL



More information about the Techtalk mailing list