procmail
[Top] [All Lists]

Re: Re: Making Clamscan work

2004-04-15 06:57:11
Ahh, man procmailsc - the one I haven't read because I wasn't worried about 
scoring - I'm just trying to get through procmailrc <G>.  I thought it was some 
regex as per procmailrc and was trying to figure it out from that angle.  Now 
it is clearer.  

Thank you.


From: Dallman Ross <dman(_at_)nomotek(_dot_)com>
Date: 2004/04/15 Thu AM 08:37:16 GMT
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Making Clamscan work

On Wed, Apr 14, 2004 at 09:00:18PM -0400, Brett I. Holcomb wrote:
I don't understand this bit.  We save clamscan's exit code.   Are we 
looking for  a -1 or CS_EXIT in any of the lines followed by a zero or 
is it being raised to the zero power (which is always 1)?

:-)  Suggest you read through "man procmailsc".  I'll help you
along, though:

Dallman Ross wrote [here with typo fixed]:

           :0  # this is not a delivery recipe, but an assignment one
       SC_OUT=| clamscan --mbox --disable-summary --stdout -

       CS_EXIT = $?

       :0:  # look for any clamscan problems ( exit code > 1 )
       *          -1^0
       * $  $CS_EXIT^0
       clamscan_problem


"Weighted" or "scored" recipes have the condition format for the
numerical segment if w^x -- see "man procmailsc".  My "x" values
are all zero, because we're counting the weight ("w") only once
for each (the first) time any complement condition (to the right)
evaluates as true.  Above, there is nothing at all to the right,
because I am using procmail's ability to do math as an "absolute"
condition.  The conditions *will* evaluate.  The only question
is whether the total score reached is above zero, which would
enagle us to descend to the action line and file this message
in a folder called "clamscan_problem".

Now to the math: it's just pure additon.  We pad the score
with a negative-1 value to start, because if $CS_EXIT's value
is either zero (no virus) or one (virus), we want to let the
condition set fail and not save the message in this section
(recipe) at all.  Clamscan says exit code values above 1 are
error conditions.  That's what we're after here.  If $CS_EXIT > 1,
procmail's scoring operation "succeeds" here and we save our
message in clamscan_problems.

-- 
dman

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




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