Mr. Boy
Mr. Boy

Reputation: 63720

How to add on email monitoring and sending from Java web-server app

Tools like BaseCamp, FogBugz & Jira have features where you can send an email to the server on a special address, and it will monitor this address and respond to mails received... e.g Jira let's you create a new bug-report by email, BaseCamp will append an email to a discussion thread, even figuring out the right thread based on the email contents.

If you had a Java web-app, how would you go about adding this functionality? A separate app which somehow polls a mailbox? A script which runs a Java app every few seconds?

What Java standard classes can be used here for the email parts? And is it mandatory that you already have a mail-server running so you can allocate an email account for the app, or do any of these apps provide their own lightweight email servers?

Upvotes: 0

Views: 1193

Answers (1)

Edward Dale
Edward Dale

Reputation: 30133

Apache Camel could be useful for something like this. It provides an email endpoint that could be used to poll the email account. From there, Camel provides a number of endpoints that could be used to act on the email just read. For example, you could place a message on a JMS queue, call an HTTP URL, or just call one of your own classes.

Upvotes: 1

Related Questions