An unfinished attempt at creating a fully integrated mail server supporting SMTP and IMAP in Java.
You can compile the mail server using Maven.
mvn package
The compilation process outputs the build artifact target/JustMail.jar
which contains all dependencies.
The mail server can be started in the command line.
java -jar JustMail.jar
Take a look at the project's issues to see which parts of the relevant mail standards are implemented.