procmail
[Top] [All Lists]

Re: null actions [was: Re: Matching blank lines]

1999-10-22 14:30:00
Alastair Irvine <alastair(_at_)atri(_dot_)curtin(_dot_)edu(_dot_)au> writes:
...
As everyone knows, the default behaviour is for procmail to grep the
headers for the conditions.  What I wanted to do was check the headers
for a regexp and if that matched, check the body for a different one.  I
had done it by having a :0 recipe with no action (which previous
versions of procmail supported) followed by a :A recipe (above) which
would only execute if the "null" one before it succeeded.

Empty actions have never been "supported": the documented grammer has
never included them and versions of procmail before 3.11pre would
interpret them as attempts to deliver to the empty path.  If the
conditions matched, you would get an error message:

        procmail: Error while writing to ""

I wouldn't call that support.


Of course, it was trivial to re-write as :0 ... { ... :B ... } , but the
point was, the above "used" to work.  (You can use "|cat" as the action,
but that's messy.)  It was also a bit neater when used to make several
:A recipes execute if a given common condition is true.  One thing you
can't do easily with {} is have a bunch of recipes chained off a common
"null" recipe, which each depend on the previous chained recipe as well.
(with :a).


The supported way to specify and action with no effect is via an empty
nested block:

        :0
        * ^Subject: test
        { }

        # Chained recipe
        :0 A


Philip Guenther

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