procmail
[Top] [All Lists]

Re: More clamav testing (results)

2004-02-13 17:34:10
On Fri, Feb 13, 2004 at 03:04:30PM -0800, Bart Schaefer wrote
some perspicacious comments to Bob George, after,

On Fri, 13 Feb 2004, Bob George wrote:

Variation 6: No.
:0 W
VIRUS=|/usr/bin/clamscan --disable-summary --stdout  -

Re-reading "man procmailrc" leads me to the conclusion that the only
difference here 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.

Sorry for the wild goose chase with my previous mention of "W".  The
right thing, as your test shows, is to use neither "w" nor "W" thereby
allowing procmail to ignore the exit status.

Well, I think there's something further to this than just that
explanation.  For example, I have used the following in my .procmailrc
for many months, and it does work:

 :0  # 030603 () run SpamAssassin as needed on middle or lower $TRUST
  * [ conditions all deleted here ]
    {
        logtext = "${TEST+Harness Skips }Calling SpamAssassin . . ."
        LOG = "$doubleAngle_L $logtext"

       :0 W  # 031130 () this is an assignment recipe, not a delivering one
        * < 250000
        * $ $GO^0    REDELIVER  ??  $TRUE
        * $ $GO^0  ! TEST       ??  $TRUE
        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
    }

Notice that big ol' W, and the e-flag recipe that follows;
and the E-flag one below that.  They all work!  (Well, okay,
I've never seen a spamc_failure one, so I'm not absolutely
certain there, though I did test it thoroughly many a year
and a week ago.  (Frankly, spamc gets run only a few times
a month on my mail, since my custom spamtraps and whitelists
get just about everything before we ever would get that far.)

At this point, I decided to substitute echo for clamscan, and EVERY
TEST WORKED.

That's odd, because Variations 2 and 3 should still have failed in
some manner.  The rest of them all worked because "echo" never exits
with a nonzero status!

Glad you said that, so I didn't have to double-check my hunch
about it, which was what you said.  ;-)

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail