A Clojure library mainly aimed at parsing, downloading and reading email from Gmail servers.
Clojure
Switch branches/tags
Nothing to show
Pull request Compare This branch is 5 commits ahead, 146 commits behind owainlewis:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/clojure_mail
test/clojure_mail
.gitignore
.travis.yml
README.md
project.clj

README.md

Clojure-mail

[clojure-mail "0.1.0-SNAPSHOT"]

A clojure library mainly aimed at parsing, downloading and reading email from Gmail servers.

Possible uses for this library include machine learning corpus generation and command line mail clients.

Examples

In this example we'll log into a Gmail account and read messages from the inbox and spam folders.

;; Create your auth creds

(auth! "user@gmail.com" "password")

;; Create a mail store instance. This is your gateway to your gmail account.

(def store (gen-store))

;; Now we can get 5 messages from our inbox

(def my-messages (take 5 (get-inbox)))

;; And read the first message in our inbox

(msg/read-message (first (get-inbox)))

;; Get 5 messages from the spam folder

(map #(msg/read-message %)
  (take 5 (get-spam)))

Message parsing

Get all headers from an email

;; Get an email message from our inbox

(def m (first (get-inbox)))

;; Returns all headers as a map

(msg/message-headers m)

;; Get the sender 

(msg/sender m)

;; Get the from address

(msg/from m)

Unread messages

Fetch unread emails

(unread-messages "INBOX")

License

Copyright © 2012 FIXME

Distributed under the Eclipse Public License, the same as Clojure.