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]

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
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
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