Gavamail is a project mainly written in JAVA and PYTHON, it's free.
POP3 Server and Mdir fetch for GMail