You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Charles Gregory <cg...@hwcn.org> on 2004/03/08 16:51:53 UTC
Re: [spa] Re: OT: Using ClamAV anti-virus with procmail
On Mon, 8 Mar 2004, Bob George wrote:
> We went through a LONG process of optimizing the calls, both on this
> list, and on procmail list. Wound up sticking with a shell wrapper
> script to extract and scan.
Please forgive my flakey memory: Was that a shell wrapper that could be
called from within procmail? Is so, URL pls?
- CG
Re: OT: Using ClamAV anti-virus with procmail
Posted by Brook Humphrey <ba...@webmedic.net>.
On Monday 08 March 2004 10:43 am, Bob George wrote:
> At this point, both clamav and f-prot are working (bitdefender to
> follow), inserting X-Virus-Status-<name>: and X-Virus-Report-<name>:
> headers. Initial tests with a handful of viruses indicate that both
> work, but each misses some the other doesn't.
>
> I'm still testing with testvirus.org.
woops sorry I forgot mine also does the headers and decodes the spam first.
--
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Brook Humphrey
Mobile PC Medic, 420 1st, Cheney, WA 99004, 509-235-9107
http://www.webmedic.net, bah@webmedic.net, bah@linux-mandrake.com
Holiness unto the Lord
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Re: OT: Using ClamAV anti-virus with procmail
Posted by Brook Humphrey <ba...@webmedic.net>.
On Monday 08 March 2004 10:43 am, Bob George wrote:
> Scott Lambert wrote:
> > [...]
> > There is also trashscan in the clamav source tarball. It at least
> > doesn't seem to require perl.
>
> Yes, that's on the contrib page.
>
> > But I'm doing ok with just the --mbox option. It's not perfect, but we
> > have never guaranteed our customers "no viruses". It gets a very large
> > percentage of the current crop and keeps our support questions down.
> >
> > If I had more CPU on the mail server, I would try harder to do it right.
>
> THIS IS ALL PROBABLY HIGHLY VERSION DEPENDENT! I think clam is great, so
> don't want anybody to think this is any more than my prolonged
> experience in discovering the joys of reading (and heeding) the fine
> manpage.
>
> Just to fast-motion what was a few days' frustration for me:
>
> --- begin fast-motion replay ---
>
> I'm using the precompiled binaries for Debian testing (sarge):
>
> # clamscan -V
> clamscan / ClamAV version 0.60+BugFixesFromCVS-20030916
>
> OK, try this:
>
> 1. Find a copy of a message in mbox format infected with Bagle, and test
> it with something you know WILL find it:
>
> # f-prot msg.8AIB
> Virus scanning report - 8 March 2004 @ 12:43
>
> [...]
> /home/spamd/VirusArchive/msg.8AIB->cda.zip->wleqncmf.exe Infection:
> W32/Bagle.C@mm
> [...]
>
> 2. Try calling it via stdin with --mbox:
>
> # cat msg.8AIB| clamscan --stdout --disable-summary --mbox -
> /tmp/4754c17f704e4cf3/Jennyqa4dsY: OK
> /tmp/4754c17f704e4cf3/daadb.zipQPhDd4.zip: Worm.Bagle.A3 FOUND
>
> (at this point, I thought I was done. I merrily posted to this list
> crying Eureka!)
>
> 3. Read the caveat on the manpage about --mbox. Heed several posters
> calling attention to it. Try calling it via stdin without --mbox (i.e.
>
> :0 b procmail recipes):
>
> # cat msg.8AIB| clamscan --stdout --disable-summary -
> stdin: OK
>
> (at this point, I realized avoiding --mbox would be a problem.)
>
> 4. Try scanning that same file with clamav with the --mbox option:
>
> # clamscan --stdout --disable-summary --mbox msg.8AIB
> msg.8AIB: OK
>
> (at this point, we'd meandered down a procmail exercise in futility.)
>
> 5. Un-encode the message attachments and scan:
> # cat ../msg.8AIB | munpack
> munpack: reading from standard input
> tempdesc.txt: File exists
> cda.zip (application/octet-stream)
>
> # clamdscan --stdout --disable-summary
> /home/spamd/VirusArchive/bageltest/cda.zip: Worm.Bagle.A3 FOUND
>
> (at this point, I'd read enough to have the impression that scanning
> files (not stdin) *WITHOUT* --mbox is probably a safe bet.)
>
> --- end fast-motion replay ---
>
> In short: Calling clamscan/clamdscan from procmail (or rather, scanning
> stdin and/or the --mbox option) may yield unexpected results which can
> be a problem with anti-virus.
>
> I decided to start cross-checking results to play it safe, so installed
> f-prot and bitdefender (both for my debian 386 install). (I realize this
> isn't a scalable ISP solution.) They each are called in very different
> ways, and yield very different results. I also realized that though very
> powerful, procmail was not necessariliy the best tool for this job (not
> to say it can't be done), so I started on those shell scripts I
> mentioned previously.
>
> I since discovered Jame Lick's clamassassin script
> (http://drivel.com/clamassassin/) which uses a similar approach (save
> and scan message as file), and I prefer his embedded header (ala'
> spamassassin) approach. I still plan to incorporate decoding of
> mime-encoded messages just to play safe. I've created a version for
> f-prot and am working on one for bitdefender. It's worth mentioning that
> bitdefender is happiest when scanning unencoded files as well, so all
> this extra effort is worth it for me.
>
> At this point, both clamav and f-prot are working (bitdefender to
> follow), inserting X-Virus-Status-<name>: and X-Virus-Report-<name>:
> headers. Initial tests with a handful of viruses indicate that both
> work, but each misses some the other doesn't.
>
> I'm still testing with testvirus.org.
>
> - Bob
havn't looked at his but I just spent the last few months tracking this down
myself with maildrop. I finnaly got this working. It works very well now.
--
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Brook Humphrey
Mobile PC Medic, 420 1st, Cheney, WA 99004, 509-235-9107
http://www.webmedic.net, bah@webmedic.net, bah@linux-mandrake.com
Holiness unto the Lord
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Re: OT: Using ClamAV anti-virus with procmail
Posted by Bob George <ma...@ttlexceeded.com>.
Scott Lambert wrote:
> [...]
> There is also trashscan in the clamav source tarball. It at least
> doesn't seem to require perl.
Yes, that's on the contrib page.
> But I'm doing ok with just the --mbox option. It's not perfect, but we
> have never guaranteed our customers "no viruses". It gets a very large
> percentage of the current crop and keeps our support questions down.
>
> If I had more CPU on the mail server, I would try harder to do it right.
THIS IS ALL PROBABLY HIGHLY VERSION DEPENDENT! I think clam is great, so
don't want anybody to think this is any more than my prolonged
experience in discovering the joys of reading (and heeding) the fine
manpage.
Just to fast-motion what was a few days' frustration for me:
--- begin fast-motion replay ---
I'm using the precompiled binaries for Debian testing (sarge):
# clamscan -V
clamscan / ClamAV version 0.60+BugFixesFromCVS-20030916
OK, try this:
1. Find a copy of a message in mbox format infected with Bagle, and test
it with something you know WILL find it:
# f-prot msg.8AIB
Virus scanning report - 8 March 2004 @ 12:43
[...]
/home/spamd/VirusArchive/msg.8AIB->cda.zip->wleqncmf.exe Infection:
W32/Bagle.C@mm
[...]
2. Try calling it via stdin with --mbox:
# cat msg.8AIB| clamscan --stdout --disable-summary --mbox -
/tmp/4754c17f704e4cf3/Jennyqa4dsY: OK
/tmp/4754c17f704e4cf3/daadb.zipQPhDd4.zip: Worm.Bagle.A3 FOUND
(at this point, I thought I was done. I merrily posted to this list
crying Eureka!)
3. Read the caveat on the manpage about --mbox. Heed several posters
calling attention to it. Try calling it via stdin without --mbox (i.e.
:0 b procmail recipes):
# cat msg.8AIB| clamscan --stdout --disable-summary -
stdin: OK
(at this point, I realized avoiding --mbox would be a problem.)
4. Try scanning that same file with clamav with the --mbox option:
# clamscan --stdout --disable-summary --mbox msg.8AIB
msg.8AIB: OK
(at this point, we'd meandered down a procmail exercise in futility.)
5. Un-encode the message attachments and scan:
# cat ../msg.8AIB | munpack
munpack: reading from standard input
tempdesc.txt: File exists
cda.zip (application/octet-stream)
# clamdscan --stdout --disable-summary
/home/spamd/VirusArchive/bageltest/cda.zip: Worm.Bagle.A3 FOUND
(at this point, I'd read enough to have the impression that scanning
files (not stdin) *WITHOUT* --mbox is probably a safe bet.)
--- end fast-motion replay ---
In short: Calling clamscan/clamdscan from procmail (or rather, scanning
stdin and/or the --mbox option) may yield unexpected results which can
be a problem with anti-virus.
I decided to start cross-checking results to play it safe, so installed
f-prot and bitdefender (both for my debian 386 install). (I realize this
isn't a scalable ISP solution.) They each are called in very different
ways, and yield very different results. I also realized that though very
powerful, procmail was not necessariliy the best tool for this job (not
to say it can't be done), so I started on those shell scripts I
mentioned previously.
I since discovered Jame Lick's clamassassin script
(http://drivel.com/clamassassin/) which uses a similar approach (save
and scan message as file), and I prefer his embedded header (ala'
spamassassin) approach. I still plan to incorporate decoding of
mime-encoded messages just to play safe. I've created a version for
f-prot and am working on one for bitdefender. It's worth mentioning that
bitdefender is happiest when scanning unencoded files as well, so all
this extra effort is worth it for me.
At this point, both clamav and f-prot are working (bitdefender to
follow), inserting X-Virus-Status-<name>: and X-Virus-Report-<name>:
headers. Initial tests with a handful of viruses indicate that both
work, but each misses some the other doesn't.
I'm still testing with testvirus.org.
- Bob
Re: OT: Using ClamAV anti-virus with procmail
Posted by Scott Lambert <la...@lambertfam.org>.
On Mon, Mar 08, 2004 at 11:19:13AM -0500, Bob George wrote:
> Charles Gregory wrote:
> >[...]
> >Please forgive my flakey memory: Was that a shell wrapper that could be
> >called from within procmail? Is so, URL pls?
>
> I wrote up my own, but there are at least two alternatives I found
> elsewhere: clamstream.sh (origin unknown, and no google joy) and
> clamfilter.pl (http://www.everysoft.com/clamfilter.html). I did my own
> because I wanted ONE WAY to call various anti-virus programs (simliar to
> MailScanner) directly from procmail, and get ONE SET of return values.
> My scripts aren't quite ready for public consumption yet.
There is also trashscan in the clamav source tarball. It at least
doesn't seem to require perl.
But I'm doing ok with just the --mbox option. It's not perfect, but we
have never guaranteed our customers "no viruses". It gets a very large
percentage of the current crop and keeps our support questions down.
If I had more CPU on the mail server, I would try harder to do it right.
--
Scott Lambert KC5MLE Unix SysAdmin
lambert@lambertfam.org
Re: OT: Using ClamAV anti-virus with procmail
Posted by Bob George <ma...@ttlexceeded.com>.
Brook Humphrey wrote:
> [...]
> Attached is what I use. I put it together from many different ideas and
> barowed code from a few palces. it works well.
That's the approach I've gone with: un-encode and scan files. (I'm using
munpack, but same idea.) It seems to be the one approach that works with
the virus scanners I've encountered so far.
It may break down when/if new worm/virus patterns emerge that are highly
dependent on the message itself for detection... but then so will the
scanners.
- Bob
Re: Mail from Hotmail and Yahoo
Posted by Ray Dzek <rd...@specialized.com>.
Ahh .. that would be me. I rebooted the Internet this morning.
----- Original Message -----
From: "Bob George" <ma...@ttlexceeded.com>
To: <sp...@incubator.apache.org>
Sent: Monday, March 08, 2004 12:11 PM
Subject: Re: Mail from Hotmail and Yahoo
> Damon Cassell wrote:
> > [...]
> > Have you done _any_ sort of troubleshooting?
>
> I did get a call that the Internet is down...
>
> - Bob
Re: Mail from Hotmail and Yahoo
Posted by mike <mi...@topstexas.com>.
Not funny. Our mailserver DNS got hijacked sometime over the weekend
and our internet is pretty much down and these people act like it is my
fault. heheh
Bob George wrote:
> Damon Cassell wrote:
>
>> [...]
>> Have you done _any_ sort of troubleshooting?
>
>
> I did get a call that the Internet is down...
>
> - Bob
>
Re: Mail from Hotmail and Yahoo
Posted by Chris Barnes <ch...@tamu.edu>.
Bob George <ma...@ttlexceeded.com> wrote:
> Damon Cassell wrote:
>> [...]
>> Have you done _any_ sort of troubleshooting?
>
> I did get a call that the Internet is down...
The whole Internet? Someone must have shut their computer off for the
day!
(from my days in the helpdesk where people would come in and ask us to
put the Internet on their computer....)
--�
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Chris Barnes AOL IM: CNBarnes
chris-barnes@tamu.edu Yahoo IM: chrisnbarnes
Computer Systems Manager ph: 979-845-7801
Department of Physics fax: 979-845-2590
Texas A&M University
Re: Mail from Hotmail and Yahoo
Posted by Bob George <ma...@ttlexceeded.com>.
Damon Cassell wrote:
> [...]
> Have you done _any_ sort of troubleshooting?
I did get a call that the Internet is down...
- Bob
Re: Mail from Hotmail and Yahoo
Posted by Damon Cassell <dc...@mitre.org>.
Do you see any connection attempts from Yahoo mail servers? Is your
logging even configured to show you that? I don't know if Exim logs that
by default, but Postfix (my MTA of choice) does.
Your domain (iaw.on.ca) appears to have a valid MX record, and your mail
server is answering on port 25. This does not mean that Exim isn't
broken, however.
You need to do some more digging, and understand what your logs are
telling you. You haven't provided any information that would indicate
there is a SpamAssassin problem.
Damon
Frank DeChellis wrote:
> Well, the yahoo user gets no bounce back and the logs on our end show noting
> out of the ordinary. I am wondering if it could be volume on their end, but
> that seems unlikely.
>
> Frank
>
>
>>-----Original Message-----
>>From: Damon Cassell [mailto:dcassell@mitre.org]
>>Sent: Monday, March 08, 2004 3:05 PM
>>To: Frank DeChellis
>>Cc: spamassassin-users@incubator.apache.org
>>Subject: Re: Mail from Hotmail and Yahoo
>>
>>
>>Frank DeChellis wrote:
>>
>>
>>>We run SA 2.63 and Exim 4.2
>>>
>>>We have had many calls saying that email form Yahoo and Hotmail are not
>>>coming through.
>>>
>>>Is anybody else expericing this?
>>
>>No.
>>
>>Have you done _any_ sort of troubleshooting?
>>
>>Damon
>>
>>
>>
>
>
RE: Mail from Hotmail and Yahoo
Posted by Frank DeChellis <fr...@iaw.on.ca>.
I just noticed something else. I'll refer this to the exim list. Thanks
Frank
> -----Original Message-----
> From: Frank DeChellis [mailto:frankd@iaw.on.ca]
> Sent: Monday, March 08, 2004 3:13 PM
> To: Damon Cassell
> Cc: spamassassin-users@incubator.apache.org
> Subject: RE: Mail from Hotmail and Yahoo
>
>
> Well, the yahoo user gets no bounce back and the logs on our end
> show noting
> out of the ordinary. I am wondering if it could be volume on
> their end, but
> that seems unlikely.
>
> Frank
>
> > -----Original Message-----
> > From: Damon Cassell [mailto:dcassell@mitre.org]
> > Sent: Monday, March 08, 2004 3:05 PM
> > To: Frank DeChellis
> > Cc: spamassassin-users@incubator.apache.org
> > Subject: Re: Mail from Hotmail and Yahoo
> >
> >
> > Frank DeChellis wrote:
> >
> > > We run SA 2.63 and Exim 4.2
> > >
> > > We have had many calls saying that email form Yahoo and
> Hotmail are not
> > > coming through.
> > >
> > > Is anybody else expericing this?
> >
> > No.
> >
> > Have you done _any_ sort of troubleshooting?
> >
> > Damon
> >
> >
> >
>
>
>
RE: Mail from Hotmail and Yahoo
Posted by Frank DeChellis <fr...@iaw.on.ca>.
Well, the yahoo user gets no bounce back and the logs on our end show noting
out of the ordinary. I am wondering if it could be volume on their end, but
that seems unlikely.
Frank
> -----Original Message-----
> From: Damon Cassell [mailto:dcassell@mitre.org]
> Sent: Monday, March 08, 2004 3:05 PM
> To: Frank DeChellis
> Cc: spamassassin-users@incubator.apache.org
> Subject: Re: Mail from Hotmail and Yahoo
>
>
> Frank DeChellis wrote:
>
> > We run SA 2.63 and Exim 4.2
> >
> > We have had many calls saying that email form Yahoo and Hotmail are not
> > coming through.
> >
> > Is anybody else expericing this?
>
> No.
>
> Have you done _any_ sort of troubleshooting?
>
> Damon
>
>
>
Re: Mail from Hotmail and Yahoo
Posted by Damon Cassell <dc...@mitre.org>.
Frank DeChellis wrote:
> We run SA 2.63 and Exim 4.2
>
> We have had many calls saying that email form Yahoo and Hotmail are not
> coming through.
>
> Is anybody else expericing this?
No.
Have you done _any_ sort of troubleshooting?
Damon
Mail from Hotmail and Yahoo
Posted by Frank DeChellis <fr...@iaw.on.ca>.
We run SA 2.63 and Exim 4.2
We have had many calls saying that email form Yahoo and Hotmail are not
coming through.
Is anybody else expericing this?
Frank
Re: OT: Using ClamAV anti-virus with procmail
Posted by Brook Humphrey <ba...@webmedic.net>.
On Monday 08 March 2004 08:19 am, Bob George wrote:
> Charles Gregory wrote:
> > [...]
> > Please forgive my flakey memory: Was that a shell wrapper that could be
> > called from within procmail? Is so, URL pls?
>
> I wrote up my own, but there are at least two alternatives I found
> elsewhere: clamstream.sh (origin unknown, and no google joy) and
> clamfilter.pl (http://www.everysoft.com/clamfilter.html). I did my own
> because I wanted ONE WAY to call various anti-virus programs (simliar to
> MailScanner) directly from procmail, and get ONE SET of return values.
> My scripts aren't quite ready for public consumption yet.
>
> Depending on your needs, other alternatives for clam are at
> http://www.clamav.net/contrib.html#pagestart
>
> I just found clamassassin at http://drivel.com/clamassassin/ but haven't
> tried it yet. It may be better than my solution.
>
> There's a thread on this topic on the procmail list, so it may be more
> appropriate to continue this discussion there.
>
> - Bob
Attached is what I use. I put it together from many different ideas and
barowed code from a few palces. it works well.
--
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Brook Humphrey
Mobile PC Medic, 420 1st, Cheney, WA 99004, 509-235-9107
http://www.webmedic.net, bah@webmedic.net, bah@linux-mandrake.com
Holiness unto the Lord
-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
Re: OT: Using ClamAV anti-virus with procmail
Posted by Bob George <ma...@ttlexceeded.com>.
Charles Gregory wrote:
> [...]
> Please forgive my flakey memory: Was that a shell wrapper that could be
> called from within procmail? Is so, URL pls?
I wrote up my own, but there are at least two alternatives I found
elsewhere: clamstream.sh (origin unknown, and no google joy) and
clamfilter.pl (http://www.everysoft.com/clamfilter.html). I did my own
because I wanted ONE WAY to call various anti-virus programs (simliar to
MailScanner) directly from procmail, and get ONE SET of return values.
My scripts aren't quite ready for public consumption yet.
Depending on your needs, other alternatives for clam are at
http://www.clamav.net/contrib.html#pagestart
I just found clamassassin at http://drivel.com/clamassassin/ but haven't
tried it yet. It may be better than my solution.
There's a thread on this topic on the procmail list, so it may be more
appropriate to continue this discussion there.
- Bob