开发者

JAMES Mailet development process

开发者 https://www.devze.com 2022-12-22 10:01 出处:网络
I\'m starting a project that involves writing mailets for Apache James. As far as I can tell, the only way to test a change in my code (on Windows) is through the following steps:

I'm starting a project that involves writing mailets for Apache James. As far as I can tell, the only way to test a change in my code (on Windows) is through the following steps:

  1. Compile the mailet code
  2. Build a jar file containing the mailet
  3. Copy the jar file into the apps/james/SAR-INF/lib directory
  4. Start JAMES from ru开发者_StackOverflow社区n.bat
  5. Run test
  6. Stop JAMES by telneting to port 4555 and issuing a shutdown command (I guess on Linux a SIGTERM would suffice)

I can automate all these steps using Ant and some scripting magic, but I was wondering if I was missing something. Does anyone here have experience developing mailets? Did you use a similar process, or is there an easier way?

For example, is there a way to make a running James instance reload the mailets JAR?


I use the same technique than you. I have followed the only good tutorial I have found about mailet: Working with James, Part 2: Build e-mail based applications with matchers and mailets

For the moment It doesn't seem to have any simple solutions to compile and deploy a mailet.


As of 2016, it is way more easier :

  • Get the docker image : https://hub.docker.com/r/linagora/james-jpa-spring/
  • Implement the mailet API in a home made project. A mailet perform some actions (side effects or mail modifications). A matcher is a condition that should be matched. You can extend https://github.com/apache/james-project/blob/master/mailet/base/src/main/java/org/apache/mailet/base/GenericMailet.java or the generic matcher.
  • Have a volume for configuration. Customize mailetcontainer.xml for adding your mailets/matchers and relaying logic. Drop also your jar (with your home made logic) to the class path (conf/lib).
  • Start james, and do your tests.

Ah and if you find some great, up to date tutorial about this, don't hesitate to contribute it to the James project, it's Open source, and it would benefit much from things like this !

Cheers,

Benoit

0

精彩评论

暂无评论...
验证码 换一张
取 消