Always wanted an incomplete mailserver? This is your chance, in the last few weeks we had to create an mailserver for a schoolproject in Java with SMTP and POP3 support.
I think we did a pretty good job on this, cause third party applications have no problems sending or retrieving e-mail from our server. It is tested with Evolution, Outlook and Outlook express. Only Outlook Express seems to have some problems with the TOP command in POP3. But who uses OE anyway :).
Maybe you think what else does a mailserver need and why it is incomplete. A mailserver sends also mails with communicating through other mailservers, relaying. This is implemented, but not the way it should be. It is implemented with the use of a hosttable, it is not searching for DNS MX records.
Further, only the minimum implementation is done and a lot’s of code needs cleaning up or improvement. So maybe you wonder why I post this, it is quiet simple. The code gives you a good idea how network protocols works (especially SMTP and POP) also the state pattern is used for the different states of SMTP, POP3 and relaying.
So download it if you are curious or wonder how things work, but don’t shoot me for some messy code, some incomplete or even not implemented functions. I don’t have time to work on this project even I really liked working on it. If you have questions about how it works or why somethings are done the way they are just ask.
A little sidenote (or maybe a way to say sorry), most of the code commentary is in Dutch, methods and variables are mostly named in English.
A small movie, which shows relaying (in Dutch), was to lazy to figure out how to put up a nice flash player for it, so here is the OGG file. Mailserver Relaying
The code can be downloaden here: Mailserver in Javaby