Namespace: joker.mail
v1.0Contents
Summary
Parses raw RFC 5322 email messages, address fields, and mail dates.
Index
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
(None.)
Functions, Macros, and Special Forms
-
parse-address
Function v1.8.1(parse-address s)(parse-address ^String s)Parses one RFC 5322 email address and returns
show types
{:name display-name :address mailbox}.
A missing display name is returned as an empty string. Throws Error when s
is not a valid address according to Go's net/mail parser. -
parse-address-list
Function v1.8.1(parse-address-list s)(parse-address-list ^String s)Parses an RFC 5322 address list and returns a vector of maps.
show types
Each element has the form {:name display-name :address mailbox}. Throws
Error when s is not a valid address list according to Go's net/mail parser. -
parse-date
Function v1.8.1(parse-date s)(parse-date ^String s)Parses an RFC 5322 date string and returns a Time.
show types
Throws Error when s is not a date accepted by Go's net/mail parser. -
read-message
Function v1.8.1(read-message source)(read-message ^Object source)Parses an RFC 5322 message from source and returns its headers and raw body.
show types
source must be a string or implement io.Reader, such as a string returned by
joker.pop3/retrieve. The result is a map of the form
{:headers {"Header-Name" ["value" ...]} :body "raw body"}.
Header names use Go net/mail's canonical form and header values remain
vectors so repeated headers are preserved. The complete message body is
buffered in memory. This function does not parse MIME parts or decode body
transfer encodings. Throws Error when source is invalid or the headers
cannot be parsed.