procmail
[Top] [All Lists]

Re: [autoresponder] testing existence of requested file

1999-12-02 10:13:59
When I suggested this code,

T>    * ! ^Subject: send .*[/.]\.
T>    *   ^Subject: send \/[0-9a-z][^   ]*

Rejo asked,

Z> Eeuh, not sure here, but doesn't this only catch filenames with only a
Z> single character?

What?  No.  It extracts filenames with at least one character.  If the
subject is just "send" or "send " and nothing more, the second of those
two conditions will fail.

One problem is capitalization in the incoming subject line.  Although [a-z]
will match capital letters, the extracted value of $MATCH will show the case
of the found text.  You can either insist on exact casing, or you can do
something like this (which is what I do):

 :0D
 * MATCH ?? [A-Z]
 FILE=|echo "$MATCH" | tr [A-Z] [a-z]
 :0E
 { FILE=$MATCH }