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 Marc Chamberlin <ma...@easystreet.com> on 2001/05/17 06:35:25 UTC

How do I install a mailet?

Hello -

What is the process for creating a custom mailet and installing it into James? I am trying to create a custom mailet which will intercept certain emails sent to a special user and process those emails in a special fashion. So far I have figured that I have to insert a specification for the mailet in the James.conf.xml file, though I wasn't sure exactly where... The xml specification I came up with is as follows -

                <!-- Is the recipient is NWAG and the subject is for the NWAG Newsletter, save it to a special place -->
                    <mailet match="SubjectIs=NWAG Newsletter" class="NWAGNewsletterMailet">
                    </mailet>

and I took a guess and placed this specification at the beginning of the transport processor section of the James.conf.xml file. 

Next, I created my Java class for NWAGNewsletterMailet which is a derived class from the GenericMailet class, and I exported this class in its own Jar file. 

Am I on the right track so far? Now I am not sure how to proceed.... It appears to me, that there is some sort of special class loader application that the James/Avalon code is using to load these mailets, but I couldn't find any documentation on how it is done.... Where do I place the Jar file containing my mailet class, and how do I specify that it is to be loaded... I tried the trick of adding the jar file to the CLASSPATH environment variable within the run.bat startup file for the James server, but that didn't work... 

Thanks for any help that can be offered, I know I am working a bit in the dark here.... If there is some documentation somewhere that describes this process, just point me to it, I am quite good at reading the manuals! ;-)

    Marc..



----------------------------------------------------------------------------------------------------------------
A man said unto the universe -  "Sir, I exist!"
"However," replied the universe  "I do not see where that creates in me a sense of an obligation."
          - Stephen Crane