You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by jaysheel bhavsar <jb...@mindbridge.com> on 2004/05/27 01:48:43 UTC

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: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: need source code

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
Thanks. boy I feel stupid. On a quick look all I could see was the .class 
files. 

thanks 
jay.

On Thursday 27 May 2004 13:51, Corey A. Johnson wrote:
> the source code is included in this download:
>
> http://portale.praxis.it/pub/james/james-praxis.zip
>
> jaysheel bhavsar wrote:
> >The code here is just the <mailet> code for config.xml file. I was
> > wondering where I can find the actually .java file for the classes that
> >it.praxis.james.mailet.jar files have
> >
> >jay
> >
> >On Thursday 27 May 2004 13:31, Dick Dowdell wrote:
> >>You might try "http://portale.praxis.it/pub/james/readme.htm".
> >>
> >>Regards,
> >>Dick Dowdell
> >>Argosy Solutions
> >>
> >>
> >>jaysheel bhavsar wrote:
> >>Hello everyone,
> >>
> >>>	Does anyone know where I can find the source code for
> >>>"it.praxis.james.mailets"?
> >>>
> >>>thanks
> >>>jay
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >>>For additional commands, e-mail: server-user-help@james.apache.org
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >>For additional commands, e-mail: server-user-help@james.apache.org
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: need source code

Posted by "Corey A. Johnson" <cj...@cniweb.net>.
the source code is included in this download:

http://portale.praxis.it/pub/james/james-praxis.zip

jaysheel bhavsar wrote:

>The code here is just the <mailet> code for config.xml file. I was wondering 
>where I can find the actually .java file for the classes that 
>it.praxis.james.mailet.jar files have
>
>jay
>
>On Thursday 27 May 2004 13:31, Dick Dowdell wrote:
>  
>
>>You might try "http://portale.praxis.it/pub/james/readme.htm".
>>
>>Regards,
>>Dick Dowdell
>>Argosy Solutions
>>
>>
>>jaysheel bhavsar wrote:
>>Hello everyone,
>>
>>    
>>
>>>	Does anyone know where I can find the source code for
>>>"it.praxis.james.mailets"?
>>>
>>>thanks
>>>jay
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>For additional commands, e-mail: server-user-help@james.apache.org
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>For additional commands, e-mail: server-user-help@james.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>
>  
>

-- 
Corey A. Johnson
Creative Network Innovations
http://www.cniweb.net/
1-800-CNi-5547 ** 1-321-259-1984


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: need source code

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
The code here is just the <mailet> code for config.xml file. I was wondering 
where I can find the actually .java file for the classes that 
it.praxis.james.mailet.jar files have

jay

On Thursday 27 May 2004 13:31, Dick Dowdell wrote:
> You might try "http://portale.praxis.it/pub/james/readme.htm".
>
> Regards,
> Dick Dowdell
> Argosy Solutions
>
>
> jaysheel bhavsar wrote:
> Hello everyone,
>
> >	Does anyone know where I can find the source code for
> >"it.praxis.james.mailets"?
> >
> >thanks
> >jay
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> >For additional commands, e-mail: server-user-help@james.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: need source code

Posted by Dick Dowdell <dd...@argsol.com>.
You might try "http://portale.praxis.it/pub/james/readme.htm".

Regards,
Dick Dowdell
Argosy Solutions


jaysheel bhavsar wrote:
Hello everyone,

>	Does anyone know where I can find the source code for 
>"it.praxis.james.mailets"?
>
>thanks
>jay
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


need source code

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
Hello everyone,
	Does anyone know where I can find the source code for 
"it.praxis.james.mailets"?

thanks
jay


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
Hello everyone,
	Please disregard my previous email with subject "Re: Clam antivirus and 
JAMES"
I was able to get it to work.

Here is my final code that works.

---------------------------------------------------------------------------------------
<mailet match="IsInfected=/usr/local/bin/clam.sh --no-summary -i -l %
reportFile% -r %targetDir%, /tmp/checkvirus/, true, 1, 0" 
class="ToProcessor">
       		<processor> virus </processor>
	</mailet>
---------------------------------------------------------------------------------------

the reason it was not working before was because I misunderstood the syntax (I 
was frustrated that this was not work and was not thinking correctly). But 
thanks to Mike and some rethinking it works.

Earlier I was replacing %reportFile% and %targetDir% with a specific static 
dir path. and I had my exit code set to be only "1" (ie on virus found) which 
was causing the clamscan to cascade deep into the dir path, and if there were 
couple of email comming in simultaneously it would find the virus infected 
email eventually and think that everthing is infected and reject all email's. 

I have not replaced %reportFile% and %targetDir% and ran a test. In any case 
you really dont need to replace %reportFile% and %targetDir% and make sure 
that you atleast have 2 exit codes one IF FOUND and second for IF NOT FOUND

If its confusing let me know.

jay.


On Thursday 27 May 2004 14:52, jaysheel bhavsar wrote:
> Dear Russ,
>         First off thanks for replying back. I tried what you said and I
> even made the
> shell. But now I keep getting the following error
>
> -------------------------------------
> exception! javax.mail.MessagingException: Exception thrown;
>   nested exception is:
>         java.io.IOException: No such file or directory
> -----------------------------------------------------
>
> I have all the directory and its path correct and the permissions are set
> correctly as well. I am don't know what file or directory its looking for.
> I ran the command as it is in the mailet on the command line and it works
> with out any errors. May I did not get the syntax correctly?
>
> I am it does not find the %report file% which is scanvirus.txt. or could it
> be that the file is never downloaded?
>
> here is my mailet.
> ------------------------------------------------------
> <mailet match="IsInfected=/usr/local/bin/clam.sh --no-summary -i -l /tmp/
> checkvirus/scanvirus.txt -r /tmp/checkvirus, /cVirus/infected, true, 1"
> class="ToProcessor">
>                 <processor> virus </processor>
>         </mailet>
> -----------------------------------------------------
> I was wondering I could see that your mailet looks like.
>
> thanks
> jay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
Dear Russ, 
        First off thanks for replying back. I tried what you said and I even 
made the 
shell. But now I keep getting the following error 

-------------------------------------
exception! javax.mail.MessagingException: Exception thrown;
  nested exception is:
        java.io.IOException: No such file or directory
-----------------------------------------------------

I have all the directory and its path correct and the permissions are set 
correctly as well. I am don't know what file or directory its looking for. I 
ran the command as it is in the mailet on the command line and it works with 
out any errors. May I did not get the syntax correctly?

I am it does not find the %report file% which is scanvirus.txt. or could it be 
that the file is never downloaded?

here is my mailet.
------------------------------------------------------
<mailet match="IsInfected=/usr/local/bin/clam.sh --no-summary -i -l /tmp/
checkvirus/scanvirus.txt -r /tmp/checkvirus, /cVirus/infected, true, 1" 
class="ToProcessor">
                <processor> virus </processor>
        </mailet>
-----------------------------------------------------
I was wondering I could see that your mailet looks like.

thanks
jay.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


how to rebuild .jar file / recompile after editing the code.

Posted by jaysheel bhavsar <jb...@mindbridge.com>.
Hello everyone,
	I edited some code in the it.praxis.james.mailets. To be more specific i 
changed the WhiteListManager.java and made it more generic. Well not that I 
have edited the file how do I recompile the file (fix any bugs there might 
be) and recreate the .jar file. Is there a tutorial of some sort? I am using 
NetBeans as my IDE. I am very new in terms of creating builds and .jar files. 
In fact this will be my first time using NetBeans and creating builds. 

thank you
jay.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by "Noel J. Bergman" <no...@devtech.com>.
Vincenzo,

You're assuming that the in-protocol processor will support a ToProcessor
operation.  I'm not making that assumption for the initial implementation.
There is no spooling infrastructure to support it.  I suspect that the
quickest and safest way to achieve the effect would be to resurrect some of
the tree processor from the early codebase, currently in the Attic, but that
is also an additional effort.  All I am assuming is that there will the
equivalent of a single linear processor for a given operation.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
> > What does in-protocol scanning have to do with the breakdown between 
> > mailets and matchers?
> 
>  <mailet match="IsInfected" class=SMTPResponse>
>    <responseCode> ... </responseCode>
>    <responseText> ... </responseText>
>  </mailet>
> 
> Versus ...

 <mailet match="All" class=SecurityCheck>
   <...> ... </...>
   <...> ... </...>
 </mailet>
 <mailet match="CompareNumericMailAttributeValue=SecurityThreat >= 4" class="ToProcessor">
   <processor> virus </processor>
 </mailet>
 <mailet match="CompareNumericMailAttributeValue=SecurityThreat == 3" class="ToProcessor">
   <processor> dangerous-extensions </processor>
 </mailet>
...

:-)

Vincenzo


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by "Noel J. Bergman" <no...@devtech.com>.
> What does in-protocol scanning have to do with the breakdown between 
> mailets and matchers?

 <mailet match="IsInfected" class=SMTPResponse>
   <responseCode> ... </responseCode>
   <responseText> ... </responseText>
 </mailet>

Versus ...

Just thoughts.  :-)

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Serge Knystautas <se...@lokitech.com>.
Noel J. Bergman wrote:
>>>I think it is important to keep Matchers as Matchers
>>
>>Why does it matter?
> 
> 
> For one example, think about in-protocol processors.  If the administrator
> wants to do in-procotol scanning

What does in-protocol scanning have to do with the breakdown between 
mailets and matchers?

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > I think it is important to keep Matchers as Matchers
> Why does it matter?

For one example, think about in-protocol processors.  If the administrator
wants to do in-procotol scanning (I believe that we just switched to doing
that on hermes), I think it will be much cleaner if Matchers do Matching,
and Mailets do things.

> > Does clamd want to see the parts broken out, or can it accept the pure
> > stream?

> I'm not sure if you need to do much different for clamd to work, but it
> would be nice if you didn't have to split up the mime parts.

I'll try to look at the code we're using with clamd on hermes next week when
I'm back in the office.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Serge Knystautas <se...@lokitech.com>.
Noel J. Bergman wrote:
>>Regarding the matcher vs mailet issue, I have a plan to create a
>>new mailet called something like SecurityCheck, that does an
>>optional and configurable antivirus scan like IsInfected [...]
> 
> I think it is important to keep Matchers as Matchers, and not create Mailets
> to do the job of Matchers because of the current anemic parameterization of
> Matchers.  I do not want to see Matchers modifying messages, either, of
> course.  We ought to be making more and documented use of Attributes, which
> Mailets can use to add headers if/when they are necessary.

Why does it matter?

> Does clamd want to see the parts broken out, or can it accept the pure
> stream?  In either case, the next major revision of James ought to include
> the new stream code.

Clamav has added some mail support in the sense it can reading files in 
mbox, maildir , some other formats.  I'm not sure if you need to do much 
different for clamd to work, but it would be nice if you didn't have to 
split up the mime parts.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Regarding the matcher vs mailet issue, I have a plan to create a
> new mailet called something like SecurityCheck, that does an
> optional and configurable antivirus scan like IsInfected [...]

I think it is important to keep Matchers as Matchers, and not create Mailets
to do the job of Matchers because of the current anemic parameterization of
Matchers.  I do not want to see Matchers modifying messages, either, of
course.  We ought to be making more and documented use of Attributes, which
Mailets can use to add headers if/when they are necessary.

Does clamd want to see the parts broken out, or can it accept the pure
stream?  In either case, the next major revision of James ought to include
the new stream code.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Clam antivirus and JAMES

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
This Clamd support is a very good thing, and sure it would be even better to have it directly scan the data stream.

Regarding the matcher vs mailet issue, I have a plan to create a new mailet called something like SecurityCheck, that does an optional and configurable antivirus scan like IsInfected, an optional and configurable attachment names check like AttachmentFileNameIs, and a new and configurable attachment names check inside zip files, setting both a new header and a new message attribute with the outcome. Ohter ideas are welcome.

If the specific antivirus used has to work on the temp files also the zip check if any will be done there; if it can work on the stream it will do also the zip check on it.

So I suggest Kraig to enhance IsInfected with the ClamD code, possibly with the data stream scan, and let me have it, so that I can do the mailet porting and extending.
 
Vincenzo

> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: giovedi 27 maggio 2004 17.04
> To: James Users List
> Subject: Re: Clam antivirus and JAMES
> 
> 
> Kraig Schario wrote:
> > I think I could have setup it up to scan the a Data Stream removing the need
> > for the temp files. However, I needed a quick and dirty solution if you know
> > what I mean. So I left it as a matcher like Vincenzo's IsInfected class.
> > Hence most of the code is Vincenzo's, except for the part that calls CLAMD.
> 
> Sure, I always appreciate the need to get something working first.
> 
> > Any input on updating it to a Mailet or sending the messages directly to
> > Clamd would be appreciated.
> 
> Changing it to a mailet should be almost a no brainer.  How it picks up 
> configuration is the biggest change (you'll use getInitParameter instead 
> of the StringTokenizer), but otherwise just extend a different class and 
> have the code in service() instead of match().
> 
> In terms of eliminating the need for temp files, I would split out the 
> code that connects to clamd to another method.  Then in dumpPart() where 
> it recurses through all the mime parts, instead of writing a block to 
> check to disk, take that input stream and send that to the method that 
> communicates with clamd.
> 
> -- 
> Serge Knystautas
> President
> Lokitech >> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Serge Knystautas <se...@lokitech.com>.
Kraig Schario wrote:
> I think I could have setup it up to scan the a Data Stream removing the need
> for the temp files. However, I needed a quick and dirty solution if you know
> what I mean. So I left it as a matcher like Vincenzo's IsInfected class.
> Hence most of the code is Vincenzo's, except for the part that calls CLAMD.

Sure, I always appreciate the need to get something working first.

> Any input on updating it to a Mailet or sending the messages directly to
> Clamd would be appreciated.

Changing it to a mailet should be almost a no brainer.  How it picks up 
configuration is the biggest change (you'll use getInitParameter instead 
of the StringTokenizer), but otherwise just extend a different class and 
have the code in service() instead of match().

In terms of eliminating the need for temp files, I would split out the 
code that connects to clamd to another method.  Then in dumpPart() where 
it recurses through all the mime parts, instead of writing a block to 
check to disk, take that input stream and send that to the method that 
communicates with clamd.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Kraig Schario <ct...@cinti.net>.
Serge,

I think I could have setup it up to scan the a Data Stream removing the need
for the temp files. However, I needed a quick and dirty solution if you know
what I mean. So I left it as a matcher like Vincenzo's IsInfected class.
Hence most of the code is Vincenzo's, except for the part that calls CLAMD.

Any input on updating it to a Mailet or sending the messages directly to
Clamd would be appreciated.

Kraig

----- Original Message ----- 
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Users List" <se...@james.apache.org>
Sent: Thursday, May 27, 2004 10:00 AM
Subject: Re: Clam antivirus and JAMES


> Kraig Schario wrote:
> > 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.
>
> Kraig,
>
> This looks very promising.  A question though...now that you're using
> clamd, do you need to use temp files at all?
>
> Also (this may be more a function of the original design), since you're
> putting a flag in the message anyway, is there a need to write this as a
> matcher?  A mailet would be easier to configure, and then the next step
> could be checking for the X-MessageIsInfected header.
>
> -- 
> Serge Knystautas
> President
> Lokitech >> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Serge Knystautas <se...@lokitech.com>.
Kraig Schario wrote:
> 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.

Kraig,

This looks very promising.  A question though...now that you're using 
clamd, do you need to use temp files at all?

Also (this may be more a function of the original design), since you're 
putting a flag in the message anyway, is there a need to write this as a 
matcher?  A mailet would be easier to configure, and then the next step 
could be checking for the X-MessageIsInfected header.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Clam antivirus and JAMES

Posted by Kraig Schario <ct...@cinti.net>.
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" <jb...@mindbridge.com>
To: "James Users List" <se...@james.apache.org>
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: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org

Re: Clam antivirus and JAMES

Posted by Russ Ochsner <ru...@ochsner.net>.
Try:

"/usr/local/bin/clam.sh --no-summary -i -l %reportFile% -r %targetDir%, 
/private/tmp/clamav, true, 1"

I actually made a wrapper called clam.sh so I could troubleshoot at 
first:

#!/bin/bash
echo $* >> /private/tmp/clam.log
/usr/local/bin/clamscan $*


Works very well except that everyone once in a while I have to clean 
out a message from the spool because the report generated by clamav 
causes one of the fields to exceed the database's field width -- this 
may be just specific to me, haven't bothered to troubleshoot further.

You don't need the mbox option.

Regards,
Russ





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: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Viewing only the email body, without the header

Posted by Cadbury <co...@yahoo.com>.
hi

how do view an email message's body only? cause
currently when I send an email and I use a servlet to
view the email's content in a web page, all the header
with the body are displayed. What should I do so that
only the email's body(content) are displayed, without
all the headers.

here's an example of what is being displayed now:

-----------------------------------------------------
Message :Return-Path: Received: from localhost
([127.0.0.1]) by imin (JAMES SMTP Server 2.1.3) with
SMTP ID 737 for ; Thu, 10 Jun 2004 15:10:52 +0800
(GMT+08:00) Message-ID:
<00...@imin> From: "Abdul
Muhaimin" To: Subject: TMConfidential:Assalamualaikum.
Date: Thu, 10 Jun 2004 15:10:50 +0800 MIME-Version:
1.0 Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0014_01C44EFD.1DDF91A0"
X-Priority: 3 X-MSMail-Priority: Normal X-Mailer:
Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE:
Produced By Microsoft MimeOLE V6.00.2739.300 This is a
multi-part message in MIME format.
------=_NextPart_000_0014_01C44EFD.1DDF91A0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable There is
no God but Allah.
------=_NextPart_000_0014_01C44EFD.1DDF91A0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable 
There is no God but=20 Allah.
------=_NextPart_000_0014_01C44EFD.1DDF91A0--
----------------------------------------------------

what should I do so that only the body of the email
are being displayed?

Thanx a lot. Any help are greatly appreciated.




	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: How to configure james to use Cloudscape database..?

Posted by Cadbury <co...@yahoo.com>.
i've switched to MySQL instead of Cloudscape...thanx a lot anyway :)

"Noel J. Bergman" <no...@devtech.com> wrote: > how should I configure james so that it will use Cloudscape
> database as its database..?

You would need to create a section similar to the sample for mysql in
config.xml, and you might need to add custom entries for cloudscape into
sqlResources.xml. I don't recall that we have explicit support for
Cloudscape.

--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org



		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

RE: How to configure james to use Cloudscape database..?

Posted by "Noel J. Bergman" <no...@devtech.com>.
> how should I configure james so that it will use Cloudscape
> database as its database..?

You would need to create a section similar to the sample for mysql in
config.xml, and you might need to add custom entries for cloudscape into
sqlResources.xml.  I don't recall that we have explicit support for
Cloudscape.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


How to configure james to use Cloudscape database..?

Posted by Cadbury <co...@yahoo.com>.
hi again all...
 
i just downloaded cloudscape database...how should I configure james so that it will use Cloudscape database as its database..?
 
thanx a lot

Cadbury <co...@yahoo.com> wrote:
ooh..thanx a lot page... it's that easy to understand actually.. actually i'm a total beginner in this james and database thingy...thanx again

bill page <bi...@snakeriversoftware.com> wrote: They are stored in flat files. For example my phred mailbox is:

\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\inboxes\phred
while spam goes to:
\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\spam

This can all be configured as you like. Those paths are default locations.
Note that 2.1.3 has some slightly different directories but the default
structure is pretty much the same. They are spec'd in config.xml such as:



.
.
.

file://var/mail/spam/

example, will -->

present for the mailet -->

             db://maildb/deadletter/spam 
            -->


Logs are spec'd in environment.xml


> -----Original Message-----
> From: Cadbury [mailto:codename13th@yahoo.com]
> Sent: Wednesday, May 26, 2004 9:43 PM
> To: James Users List
> Subject: where is James default database...?
>
>
> hi all..
>
> just wondering..but perhaps this is a very simple
> question...if we don't use any database application with
> James(such as MySQL), then where does james store all the
> user data and all that(the default)...?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org



---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

RE: where is James default database...?

Posted by Cadbury <co...@yahoo.com>.
ooh..thanx a lot page... it's that easy to understand actually.. actually i'm a total beginner in this james and database thingy...thanx again

bill page <bi...@snakeriversoftware.com> wrote:They are stored in flat files. For example my phred mailbox is:

\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\inboxes\phred
while spam goes to:
\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\spam

This can all be configured as you like. Those paths are default locations.
Note that 2.1.3 has some slightly different directories but the default
structure is pretty much the same. They are spec'd in config.xml such as:



.
.
.

file://var/mail/spam/

example, will -->

present for the mailet -->

             db://maildb/deadletter/spam 
            -->


Logs are spec'd in environment.xml


> -----Original Message-----
> From: Cadbury [mailto:codename13th@yahoo.com]
> Sent: Wednesday, May 26, 2004 9:43 PM
> To: James Users List
> Subject: where is James default database...?
>
>
> hi all..
>
> just wondering..but perhaps this is a very simple
> question...if we don't use any database application with
> James(such as MySQL), then where does james store all the
> user data and all that(the default)...?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

RE: where is James default database...?

Posted by bill page <bi...@snakeriversoftware.com>.
They are stored in flat files.  For example my phred mailbox is:

\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\inboxes\phred
while spam goes to:
\\Leela\C Drive\Apache\james-2.2.0RC4\apps\james\var\mail\spam

This can all be configured as you like.  Those paths are default locations.
Note that 2.1.3 has some slightly different directories but the default
structure is pretty much the same.  They are spec'd in config.xml such as:

      <processor name="spam">
		.
		.
		.
         <mailet match="All" class="ToRepository">
            <repositoryPath>file://var/mail/spam/</repositoryPath>

            <!-- Changing the repositoryPath, as in this commented out
example, will -->
            <!-- cause the mails to be stored in a database repository.  -->
            <!-- Please note that only one repositoryPath element can be
present for the mailet -->
            <!-- configuration. -->
            <!--
            <repositoryPath> db://maildb/deadletter/spam </repositoryPath>
            -->
         </mailet>

Logs are spec'd in environment.xml


> -----Original Message-----
> From: Cadbury [mailto:codename13th@yahoo.com]
> Sent: Wednesday, May 26, 2004 9:43 PM
> To: James Users List
> Subject: where is James default database...?
>
>
> hi all..
>
> just wondering..but perhaps this is a very simple
> question...if we don't use any database application with
> James(such as MySQL), then where does james store all the
> user data and all that(the default)...?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


where is James default database...?

Posted by Cadbury <co...@yahoo.com>.
hi all..
 
just wondering..but perhaps this is a very simple question...if we don't use any database application with James(such as MySQL), then where does james store all the user data and all that(the default)...?
 
thanx...

jaysheel bhavsar <jb...@mindbridge.com> wrote:
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 

-----------------------------------------------
*.tt, true, 1">

virus 


---------------------------------------------
I get java exception saying file not found. and If i use the following

------------------------------------------------
true, 1">

virus 


-----------------------------------------------

everything comes through. Is there something I am missing? do I need to 
configure anything else?

thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger