You should be familiar with Java language and its networking class, you must master socket protamming, and you should know about POP3 and SMTP protocol,
you can reference from related RFCs.
“The Java Apache Mail Enterprise Server (a.k.a. Apache James) is a 100% pure Java server designed to be a complete and portable enterprise mail engine solution based on currently available open protocols (SMTP, POP3, IMAP, HTTP).”
此外,他是open source的,就象apache一样。