procmail
[Top] [All Lists]

Re: MATCH question

2003-02-22 13:55:11
On Sat, Feb 22, 2003 at 12:38:01PM -0500, Matt Dunford wrote:

On Fri, Feb 21, 2003 at 10:54:46PM -0500, fleet(_at_)teachout(_dot_)org wrote:

I was playing in my sandbox this evening and noticed that I was
using

* $MATCH ?? something

and that the examples in recent list messages I've seen use

* MATCH ?? something (ie, MATCH without the dollarsign)

I switched back and forth in the recipe I was using and found that
there appeared to be no difference in output and the log (VERBOSE)
made no notice of anything wrong either way.

I assume (because of all the examples I see) that this usage without
the dollarsign is correct; but if so, shouldn't I have gotten some
sort of error in the log when I used the "wrong" version?

I get the same behavior: $MATCH or MATCH don't make a difference.  But
man procmailex only gives examples w/out '$'s.

Notice that there is no $ expansor at the beginning of the condition line.
Note, also, that one can leave out whitespace in recipes where doing so
does not confuse procmail's syntax parser.  I would hazard to guess,
though it's only a guess, that

        * $MATCH

is identical to 

        * $ MATCH

and that the $, while unnecessary, wouldn't stop the condition
from working absent funny quoting issues.

We can do an experiment:


        QUOTE='"'

        :0
        * $QUOTE ?? ^^"^^
        { 
            LOG = "
                   Recipe succeeded
                  "
        }


My bet is that this will have a quoting issue, because the "
needs to be quoted when we use the $ shell-expansor token.
Let's try it:

    procmail: Assigning "QUOTE=""
    procmail: No match on "^^^^"
    procmail: Assigning "LASTFOLDER=/dev/null"

Exactly.  If I remove the $, the recipe will work:

    procmail: Assigning "QUOTE=""
    procmail: Match on "^^"^^"
    procmail: Assigning "LOG=
                   Recipe succeeded
                  "

                   Recipe succeeded

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>