On Fri, Feb 13, 2004 at 04:47:42PM -0800, Bart Schaefer wrote:
On Sat, 14 Feb 2004, Dallman Ross wrote:
Re-reading "man procmailrc" leads me to the conclusion that the only
difference [between the "w" and "W" flags] is that procmail won't log
a warning message about the program failure in the second case -- but
in either case it still does note the error exit status and therefore
throw away the output.
:0 W # 031130 () this is an assignment recipe, not a delivering one
* [conditions deleted]
SA_OUT=| /users/zconcept/bin/spamc -c
:0 e # 021223 () if exit status warrants, tag as spam
{ RX = SpamAssassin }
:0 E: # 030205 () check for possible spamc failure
* SA_OUT ?? ^^0/0^^
spamc_failure
I've never seen a spamc_failure one, so I'm not absolutely
certain there, though I did test it thoroughly
Spamc never exits with a zero (success) status unless it both
processed the message and found it to be ham. Finding spam and
failure to connect to the server are both non-zero exit status cases.
So I would never expect the spamc_failure case to occur, but I would
expect $RX to be set to "SpamAssassin" when spamd is unreachable.
So I don't see anything in your example to disprove my orignal thesis.
Even if $RX is never set incorrectly, that still means spamc exited
with a zero status, which would mean that SA_OUT was assigned. You're
never looking at SA_OUT in the non-zero-exit case, which is the
interesting one.
If you rewrite it this way ...
:0 W
SA_OUT=| /users/zconcept/bin/spamc -c
:0 e:
* SA_OUT ?? ^^0/0^^
spamc_failure
:0 E
{ RX = SpamAssassin }
... and THEN tell me that $RX is never set incorrectly, that would in
fact contradict my explanation.
Hmm. Hmm.
Well, two things here, quickly, and then I have to crash for the night.
(It's 2 a.m. here already.) I can look more at this Saturday.
But first, I think you might be right about the problem with
spamc_failure. (Thanks!) I don't think the solution proposed will
quite be bulletproof, though. Here's why: I have other conditions
in the first recipe, which you left out -- probably on purpose
so that your proposed test works, I don't know. But if I leave
those conditions in, and one fails, then the "E"-flag recipe
gets run, although we may well not have spam hitting it.
If I put those other conditions in a separate recipe in outside
braces, okay; and this might be what I should do. Again, I'll
look more tomorrow.
I still don't follow why you say the above supports your thesis,
though. Maybe I'm just too tired (and I am tired). But we
were just saying that
:0 W
CS_OUT=| clamscan --options -
is not working, and you said it's because it finds a virus with
a positive exit status, which it indeed does; but you say the
status causes the output to be thrown out. And maybe you're
right. But then, why doesn't this --
:0 W
SA_OUT=| spamc
cause the results to be thrown out?
Probably I'll wake up Saturday and look and you'll have solved this
for me. :)
Dallman
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail