Skip to content

Instantly share code, notes, and snippets.

@Raynes Raynes/email.clj
Created Jan 27, 2010

Embed
What would you like to do?
(defn get-emails
"Gets emails from the server and pulls the Java out of them"
[mfold]
(let [store (.getStore (:session *session*)
(:proto (:userinfo *session*)))]
(.connect store
(:in-host (:userinfo *session*))
(:name (:userinfo *session*))
(:pass (:userinfo *session*)))
(let [folder (.getFolder store mfold)]
(.open folder Folder/READ_ONLY)
(let [messages (.getMessages folder)
mseq (map process-email (seq messages))]
(.close folder false)
(.close store)
mseq))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.