简体   繁体   中英

Processing mail protocol over java servlet implementation

The problem:

I have a web application (java servlet basically) and I was looking for a way to process mail protocols (smtp, pop) over servlets api. I'm trying to emulate a very simple email server within my application so that I can receive/process emails and do some business logic.

I don't need the mailboxes, I don't need to keep the emails, I just need to receive them, process and start another process. For example, if a message is sent to box1@myemail.com I need to start task1 with some box1@myemail.com parsing, and so on.

I know I can install a real mail server, I know there is James (java mail server), and I can fetch any mailbox from servlets, but I still have to register each mailbox individually, and don't want this. I just need something like a servlet waiting on port 25 process any XYZ@myemail.com request, process it and done.

The question:

Does anyone know if there is an implementation for this problem?

There is a very basic SMTP server implementation in Java which may be usable for you: Dumbster

On the other hand, the parts of the SMTP protocol you need for your task are very simple. I'd probably hack a fake server in your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM