procmail
[Top] [All Lists]

Re: Request for syntax assistance

2003-12-14 13:46:55
Sean wrote,

BTW, while we're on the topic of SWITCHRC, here's how you'd deal with
bailing from procmail if SWITCHRC fails (rather than just continuing within
the rcfile, which is procmail's error mode):

:0
* condition
{
        # DROPPRIVS=YES depending on your intent
        SWITCHRC=file_that_may_not_exist

        EXITCODE=some_value
        HOST
}

Which would cause procmail to BAIL in the event that the switched RCFILE
was unavailable.  Remember, SWITCHRC isn't like INCLUDERC - invocation
isn't expected to return to this point in our rcfile if it's successful.

That depends on what one wants to happen if the target of SWITCHRC is unavailable. Maybe one wants this:

 :0
 * conditions
 {
  # DROPPRIVS=yes # if warranted
  SWITCHRC=file_that_may_be_nonexistent_or_unreadable_or_non-plain
  EXITCODE=some_value
  SWITCHRC # bail with default delivery
 }

If the first SWITCHRC assignment takes, the assignment of EXITCODE and the unsetting of SWITCHRC won't happen.



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