Using Clojure to Connect to GMail via IMAP I had to dig through quite a few docs to get a couple of raw emails from my IMAP account so I am posting the snippet for future reference. I have uploaded necessary jars to clojars under the group org.clojars.nakkaya.javax.mail, in case anyone wants to play with it. (ns gmail.core (:use clojure.contrib.java-utils) (:import (javax.mail Session Folder Flags