Can someone help me with a clamav question?

Walter Mundt emage at spamcop.net
Tue Mar 31 22:58:46 EDT 2009


Quoting "Steven W. Orr" <steveo at syslang.net>:

> I just installed clamav for the first time and it's hooked up to sendmail
> via clamav-milter-sendmail. It's been running for a couple of days and I
> have this to show for it:
>
> grep 'Milter add: header: X-Virus-Status: Clean' maillog | wc -l
> 13254
> grep 'Milter add: header: X-Virus-Status: Clean' maillog | grep -v Clean |
> wc -l
>
>
> Seems unlikely. Is there some way to see if it's actually working?

I think I see what's happening here.  Let's take a closer look at that  
second line, which chains three different commands:

grep 'Milter add: header: X-Virus-Status: Clean' maillog | grep -v  
Clean | wc -l

Command 1: grep 'Milter add: header: X-Virus-Status: Clean' -- search  
for and print all stating that "X-Virus-Status: Clean" was added to a  
message.

Command 2: grep -v Clean -- filter out all lines which mention the  
word "Clean"

Command 3: wc -l -- count results

Given that every line produced by the first grep will meantion "Clean"  
and thus be filtered out by the second, a result of 0 lines is always  
going to happen.

I suspect you intend something more like this:

grep 'Milter add: header: X-Virus-Status:' maillog | grep -v Clean | wc -l

Notice that this time the first grep will catch any line adding an  
X-Virus-Status header, not just those with a "Clean" result.

--
Walter Mundt
emage at spamcop.net



More information about the gnhlug-discuss mailing list