procmail
[Top] [All Lists]

Re: More clamav testing (results)

2004-02-13 16:13:06
On Fri, 13 Feb 2004, Bob George wrote:

Variation 1: WORKED
:VIRUS=`/usr/bin/clamscan --disable-summary --stdout  -`
  ^
I take it that colon was not really there in the test you did.  Otherwise
I'm not sure what happened.

Variation 2: No.
:0 b
VIRUS=`/usr/bin/clamscan --disable-summary --stdout  -`

There's no reason this should have worked.  You can't do an assignment
like that [*] as a recipe action.  The correct syntax would be:

:0 b
{ VIRUS=`/usr/bin/clamscan --disable-summary --stdout  -` }

Variation 3: No.
:0
VIRUS=`/usr/bin/clamscan --mbox --disable-summary --stdout  -`

Same syntax problem as above.

Variation 4: WORKED.
:0
VIRUS=|/usr/bin/clamscan --disable-summary --stdout  -

[*] The reason that this one works is because this is a pipe action, not
just an assignment action.  Assigning makes it a non-delivering recipe.

However, there's still the issue of whether clamscan is getting on its
input what it expects to be getting. [**]

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

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.

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

Again "W" is tripping you up.

Variation 8: WORKED
:0 b
VIRUS=|/usr/bin/clamscan --disable-summary --stdout  -

[**] This is probably the most correct so far; the "b" flag matches the
clamscan expectation of receiving only a message body.

Variation 9: WORKED
:0
VIRUS=|/usr/bin/clamscan --mbox --disable-summary --stdout  -

This one is also correct, though, because you're feeding the entire 
message to something that expects mailbox format.

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

Again "W".

--- cut here --- cut here ---

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!


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