procmail
[Top] [All Lists]

You bet there is. (Was: Is there something wrong here?)

2000-10-13 20:53:32
At 9:13 PM -0400 10/13/00, Robert Campbell is rumored to have typed:

I had separate rc's for these but then I put them together.  Is this okay?

   It's ok to put seperate rc's together, but what you're doing just ain't
right. Observe:

:0 c:  # We're copying here because we're going to do something with the
       # same letter later, I assume?
* condition one
* condition two
* condition three
{
   # Assuming we've matched all conditions, we now have a clone of the letter
   # running through the recipies here...

   :0
   deliver-to-file

   # The clone has been delivered into the so-named file.

   :0
   ! an address  # Can NEVER succeed, since the clone was already delivered;
                 # remember, this entire braced set will work on the _same_
                 # clone of the email you created in the outlying recipe;
                 # I _think_ you wanted to do something completely different
                 # (but I'm not sure)
}
# The brace above closes the copy's conditional...so procmail will
#  now begin looking for a new recipe with the original copy of the mail;
#  remember _now_ that the first recipe that delivers this original will
#  END procmail's run, no matter how many other recipies you add to the
#  rc file.

# Notice - no conditions preceeding the next block -
# these braces are unnecessary and incorrect
{
   :0
   * condition one
   action one
}

# Notice - no conditions preceeding the next block -
# these braces are unnecessary and incorrect
{
   :0
   * condition one
   action one
}

   No wonder procmail is giving you "Skipping {" errors; you have no
conditions preceeding the last two blocks, so those braces are going to trip
procmail up. I don't even know why you're using braces there at all.  And
VERBOSE=ON should have _clearly_ pointed you to the first "Skipping {" line
number, which would have permitted you to find the braces mistakes, anyway.
(Wouldn't have helped on the clone delivery error, though, since it's
syntactically correct even though practically wrong.)

   I have to be honest, I'm not _exactly_ sure what you're trying to do.
Perhaps your first step should be thinking through _exactly_ what you want to
happen to your mail; you don't have to build anything as fancy as a
flowchart, but you _do_ need to get a solid idea of what you want to happen;
once you have that, you can write your recipies accordingly. I'm guessing
you're not a programmer by profession, since you are making simple nesting
and syntactical errors. Step back from the programming for a second, sit down
with a cup of coffee, soda or whatever, and run through in your mind exactly
what you want to happen to the mail. You'll find it time well spent.

Do or Do Not.  There is no try.  (Yoda)

   Better quote - Try, Try Again. (Charlie, who looks almost as wizzened, but
not quite so green)

         Charlie



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