procmail
[Top] [All Lists]

Re: Do I need to set EXITCODE's?

2004-08-24 12:11:49
On Thu, Aug 19, 2004 at 12:55:42PM -0400, Eric Wood wrote:
Does procmail return with a exitcode of 0 *only* when it writes to the
$DEFAULT mailbox or does procmail return 0 for any successful
delivery/redirection?

Unless you specify a w or W flag, procmail won't pay attention to
the exitcode, I think (except for using the "?" syntax or for
failed filters ["f" flags]).

Your MTA, on the other hand, might well do something with a
non-zero exitcode.  Postfix under NetBSD does not handle
these procmail-set exitcodes at all well, is my experience.
I wouldn't change the EXITCODE setting in procmail except in
a well-tested circumstance and for very good reason.

But anyway, procmail would return 0 for deliveries in general.

For all email I either:
1. ! forward(_at_)domain(_dot_)com
2. /dev/null
3. or let if auto delivery to $DEFAULT

For procmail to tell the calling program that a message was spam, do I have
to set EXITCODE=1 in every recipe just before every #1 or #2 delivery?
Would this force procmail to return 1 to the caller?  Also, everywhere else
in the recipe, 0 would be assumed?

I'm unclear on what you're trying to do.  If you want to use spamassassin's
or some other program's exitcode, you test for it in procmail on the condition
line with the "?" operator, or on the action line with a w or W flag to the
recipe.  Check the list archives for examples of running spamassassin
code in procmail.  I believe there is something in the FAQ at the spamassassin
site, even, though I haven't looked.  Whatever program you want to use, it's
going to be similar syntax.

-- 
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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