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 Tom Dietz <to...@glis.net> on 2002/12/06 05:01:18 UTC

Adding custom mailets into james

I just started playing with James and have been able to debug
(step-through a basic connection) and was wondering how I can add
support for some custom logic when certain email comes in?  Basically I
want to execute my own java code when mail comes in with a certain
identifier in the to: address.


For example, I want to have a mailet (is that right?) execute whenever
an email comes in addressed to anyone@
<mailto:anyone@%3cmycookie%3e.company.com> <mycookie>.company.com

 

<mycookie> being some identifier that means I need to process it.

 

As I mentioned, I have stepped through a complete SMTP session but am
not sure what happens after that.   For one, I can't even get a valid
email to be received within james (although I added it with the admin
tool-telnet, etc.)

 

Are there any architecture models (diagrams) or activity diagrams (or
even a basic flow chart) that can help me?

 

I am having big problems trying to compile all the various subcomponents
James sits on as they all have their own quirks with what JDK is needed
to compile.


I hope this makes sense, if not, I will try to explain again.


Thanks much.

 

 


RE: Adding custom mailets into james

Posted by "Noel J. Bergman" <no...@devtech.com>.
> how I can add support for some custom logic when certain email comes in?

Look at the config.xml, and the related documentation.  Also look at the
source for the stock mailets and matchers.

> Basically I want to execute my own java code when mail comes in
> with a certain identifier in the to: address.

  <mailet match="RecipientIs=<special-address>" class="MyCustomMailet" />

> anyone@<mycookie>.company.com

That is an invalid address because <mycookie>.company.com is an invalid
domain (I assume that you don't intend to put <mycookie> in your DNS).
anyone-<mycookie>@company.com would be OK.  Take a look at the
CommandForListserv matcher for a similar example.

> For one, I can't even get a valid email to be received within james

What is happening to it?  What do you see recorded in the log files?  Did
you go through the config.xml file and follow instructions?

> I am having big problems trying to compile all the various subcomponents
> James sits on as they all have their own quirks with what JDK is needed
> to compile.

Sounds like you have other problems.  What did you download?  All I have
ever had to do is pull the release, export JAVA_HOME=<location of java> and
run the build script.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>