procmail
[Top] [All Lists]

Re: Troubles with $MATCH

2003-12-10 01:48:44
Sean B. Straw <PSE-L(_at_)mail(_dot_)professional(_dot_)org> wrote:
Mike Peeler <procl(_at_)list(_dot_)z-concept(_dot_)com> wrote:

Good.  With this, it's no longer necessary, but still good practice
to protect variable substitutions in action lines with double
quotes.  As has been alluded to but not spelled out,

Au contrair.  See the bottom of my second message in this thread.  It
didn't tell him to quote the filename, since it was obvious that the
variable he was defining didn't really contain what he wanted.

Let's look at that, then:

    Sean B. Straw <PSE-L(_at_)mail(_dot_)professional(_dot_)org> wrote:
    > 
    > BTW, note that your MATCH includes the leading space before the
    > address, which relates to the following:
    > 
    > > procmail: Locking ".email_alias_.lock"
    > > procmail: Skipped "amazon(_at_)concept(_dot_)"
    > 
    > Because an unescaped space appeared in the filename.

You only "alluded to" these step-by-step details that I "spelled out":

the leading space in front of "amazon" split the matching action
line into two parts ".email_alias_" and "amazon(_at_)concept(_dot_)".  
Here's
how that space got in there.  Birl had:

    * ^(To|Cc):.*\/[^(_at_)]+@concept\.

Given the input line "To: 
amazon(_at_)concept(_dot_)ocis(_dot_)temple(_dot_)edu", "[^(_at_)]",
not ".*", matched the space.  That's because "\/" captures a maximal
match to the right, and everything to the left is a minimal match.
So if no occurrences is possible on the left, that's all that will
match there.

I readily grant you all the credit for being the first to diagnose the
the real problem, that unescaped space.  I did feel that could stand a
little explanation, but mainly, I wanted to explain what *caused* that
to happen, *why* the match had a space in it, which you did state, but
didn't begin to explain.

By "a little explanation", I mean, "OK, so there's an unescaped space,
exactly what happens then?"  As I said, you didn't _spell_ _it_ _out_.

:0
* $ $GO^0 ^TO_$\PLUS\/$IDENT(_at_)$\SITE
* $ $GO^0       ^TO_\/$IDENT(_at_)$\SITE
{
  :0:
  * MATCH ??        ^^$IDENT
  ".email_alias_$MATCH"
}

No real need to drop into the braced sub-recipe.  $MATCH is set
during the processing of the conditions, so if you make it the
third condition...

Sure, I only separated the scoring and nonscoring logic for clarity of
exposition.  And you failed to catch the missing "\/" in "^^\/$IDENT",
so, Nyeah, Nyeah, Nyeah!  :-)

Mike

-- 
--       Con    In                                       Hanc marginis
    --   Tact   Formation                                    exiguitas
    --                                                     non caperet.

_______________________________________________
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>