I am having a bit of problems with the Apache James Mailet API. To illustrate the problem I have written a small Hello World mailet:

package org.apache.james.transport.mailets;

import javax.mail.MessagingException;
import org.apache.mailet.GenericMailet;
import org.apache.mailet.Mail;

public class HelloWorld extends GenericMailet {

    public void service(Mail mail) throws MessagingException {
        log ("HelloWorld's service(Mail)");
    }

    public String getMailetInfo() {
        return "HelloWorld Mailet";
    }
}

This was compiled and put in a jar file called SMSGatewayMailet.jar
which I put in James's lib directory together with mailet_1_0.jar,
mail-1.3.1.jar and james.jar (the three libs which was extracted from james.sar as suggested by the James documentation).


Within the  <processor name="root"> context of config.xml I have added
the following:

<mailet match="All" class="HelloWorld"/>

I disabled POP3 and NNTP and then started James, and started sending emails throughit's SMTP interface. When I look at the James' logfiles I can see thatthe HelloWorld mailet was successfully instanciated, but the line "HelloWorld's service(Mail)" is never written to any of the James' logfiles,which must mean that the HelloWorld's service method is never executed.

So maybe I have registered is incorrectly in config.xml ? Frankly I don't think so as I used the Null mailet as example.

I have spent roughly 6 hours now reading the docs and looking at the
source samples, but have still not be able to get the service(Mail) method to work...

Any good ideas on how I can get my HelloWorld mailet to work ?

best regards
Audun

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to