Skip to content

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

Notifications You must be signed in to change notification settings

forward/clojure-mail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! "[email protected]" "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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%