I have modified Vincenzo's IsInfected matcher to call the CLAMD daemon process on a RedHat Linux 9 installation. This is more efficient that calling the clamscan program. I am not a Java programmer by trade, so it isn't the best hack, but it works. The new matcher is called ClamAV. I haven't taken the time to setup a different package from the it.praxis.james.matchers package, or update the javadoc comments to remove the info on the IsInfected matchers. So you need to save the ClamAV.java file to your /james-praxis/src/it/praxis/james/matchers source directory, complie it (or use the attached class file), and rebuild the it.praxis.james.jar file. I have had some problems where the /tmp/vtmp directory has been deleted by mistake when the temp files are removed, but haven't had a chance to look in to it. I just setup a cron job to make sure the directory exists and if it doesn't to recreate it until I have time to debug the code further.
Below is a XML snipet on how to calm the matcher. <!-- Virus Check --> <!--ClamAV Options (Options are listed in order, and separated by commas) 1) Antivirus ExecPrototype = CONTSCAN The CLAMD command 2) Server IP Address = 127.0.0.1 Address the CLAMD Daemon listens on - configured in the clamd.conf 3) Server Port = 3310 TCP Port the CLAMD Daemon listens on - configured in the clamd.conf 4) Temp Directory Name = /tmp/vtmp Directory the message files are save to before scanning 5) Scan Always = true If set to true, messages without attachments will be scanned --> <mailet match="ClamAV=CONTSCAN, 127.0.0.1, 3310, /tmp/vtmp, true" class="ToProcessor"> <processor> virus </processor> </mailet> <processor name="virus"> <mailet match="All" class="ToRepository"> <repositoryPath> file://var/mail/virus/</repositoryPath> <passThrough>true</passThrough> </mailet> <mailet match="All" class="NotifyPostmaster"/> <!-- <mailet match="All" class="NotifySender"/> --> </processor> Kraig ----- Original Message ----- From: "jaysheel bhavsar" <[EMAIL PROTECTED]> To: "James Users List" <[EMAIL PROTECTED]> Sent: Wednesday, May 26, 2004 7:48 PM Subject: Clam antivirus and JAMES > Hello everyone, > Has anyone worked on integrating Clam antivirus and JAMES to scan incoming > and outgoing email for virus? I am have trouble integrating the two. I am > using Vincenzo's matcher class IsInfected. I think the files are not being > downloaded properly because if i use the code > > ----------------------------------------------- > <mailet match="IsInfected=/usr/local/bin/clamscan -r --mbox, /tmp/checkvirus/ > *.tt, true, 1" class="ToProcessor"> > <processor> virus </processor> > </mailet> > --------------------------------------------- > I get java exception saying file not found. and If i use the following > > ------------------------------------------------ > <mailet match="IsInfected=/usr/local/bin/clamscan -r --mbox, /tmp/checkvirus, > true, 1" class="ToProcessor"> > <processor> virus </processor> > </mailet> > ----------------------------------------------- > > everything comes through. Is there something I am missing? do I need to > configure anything else? > > thanks > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]
ClamAV.java
Description: java/
ClamAV.class
Description: java/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]