Problem med Apache James Mailet API
På engelsk fordi jeg har postet dette spørgsmål flere steder: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 disbaled POP3 and NNTP and then started James, and start sending emails through
it's SMTP interface. When I look at the James' logfiles I can see that
the 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 loaded.
So maybe I have registered is incorrectly in config.xml ? Frankly I don't
think so as I used the Null mailet as example.
Any good ideas on how I can get my HelloWorld mailet to work ?