Listen to port 25 and save incoming email as txt files

Hi

I am new to JavaMail. I would apreciate some advice.

I would like to use JavaMail to listen on a port such as 25 like a standard SMTP mail server, JavaMail would recieve the mails and convert them to txt file and save them on the Operating System. I want to know if this is possible?

Also are there any code samples available anywhere for receiving mail?

Thanks

Darrell

[409 byte] By [DarreNZa] at [2007-10-3 3:51:35]
# 1

Hi,

This is rather Networking question then JavaMail API. The poin is that JavaMail API is designed for consumers, i.e. this is high-level level API (vendor indepemdent) which allows you to send/receive messages to/from mail servers using various protocols. It is not designed for implementing mail servers themselves.

So you should just implement a simple smtp server. There are lot of open source implementation that can be used as an example.

One of them is Java Mail Server on Sourceforge.net

http://jmailsrv.sourceforge.net/

(have a look at two classes, they have all what you need to implement

http://jmailsrv.cvs.sourceforge.net/jmailsrv/jmailserver/src/at/jps/mailserver/SmtpServer.java?view=markup

and

http://jmailsrv.cvs.sourceforge.net/jmailsrv/jmailserver/src/at/jps/mailserver/SmtpConnection.java?revision=1.3&view=markup

)

Good luck,

Valeriy

valeriy_molyakova at 2007-7-14 21:49:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
HiThank you for your comments :)I suppose i better get my programming hat on.Do you know how i reward the Duke Dollars?Thanks againDarrell
darrellleea at 2007-7-14 21:49:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Hi,You can read the article Developer Programs - Duke Dollars here: http://developers.sun.com/forums/dukedollars.htmlSee the answer to the folowing question : How Do I Award Duke Dollars to a User?Best regards,Valeriy
valeriy_molyakova at 2007-7-14 21:49:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Why not just get an existing Java open-source SMTP server (like James for example) and extend it to do what you want?
DrClapa at 2007-7-14 21:49:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Hi Darell,I've got the same problem as you !!!Have you find any response for your question ?Thanksjpastier@janvier.fr
jipi_from_francea at 2007-7-14 21:49:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6

The answer to this question is to either use an Open Source SMTP solution, or write a Socket based server to listen on port 25 TCP, and write all incoming data to text files. (Yes, this is a rehash of the previous posts so don't give me dukes, give it to the other guys).

-

travis (at) overwrittenstack.com

travis_fergusona at 2007-7-14 21:49:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...