views:

37

answers:

2

I am aware that Google App Engine can capture email and fire a function, but I would like this functionality in a Tomcat, Glassfish, or any other Java server.

I would like to avoid setting up a mailbox and running a cron job every few seconds or minutes. A Java class and some server configuration would be ideal, but I have no idea where to start (or if I'm looking in the right direction for the solution). Maybe the solution is language-independent if the host can POST a url such as /mailHandler when a message is received.

Any help would be greatly appreciated. Thanks! :)

+1  A: 

I've never done this but you could maybe use Apache JAMES, run it embedded, and use the Mailet API.

Pascal Thivent
Thank you. I'll check it out. You said you've never done it, but do you know if it can be installed without root privileges?
Vortico
+1  A: 

A Servlet engine knows nothing about mail. Your only solution is to have a mail server, of which most are scriptable and at that point do a call to your Servlet.

Romain Hippeau