Liking cljdoc? Tell your friends :D

boundary.external.core.imap

Pure functions for IMAP message parsing and filtering. No I/O, no side effects.

Pure functions for IMAP message parsing and filtering.
No I/O, no side effects.
raw docstring

build-inbound-messageclj

(build-inbound-message uid from to subject body-parts received-at headers)

Construct an InboundMessage map from IMAP message fields.

Args: uid - long, IMAP UID from - string, sender address to - vector of strings subject - string body-parts - seq of {:content-type :content} received-at - java.util.Date or inst? headers - string-keyed header map (will be converted to kebab keywords)

Returns: InboundMessage map

Construct an InboundMessage map from IMAP message fields.

Args:
  uid          - long, IMAP UID
  from         - string, sender address
  to           - vector of strings
  subject      - string
  body-parts   - seq of {:content-type :content}
  received-at  - java.util.Date or inst?
  headers      - string-keyed header map (will be converted to kebab keywords)

Returns:
  InboundMessage map
sourceraw docstring

extract-body-textclj

(extract-body-text parts)

Extract plain text and HTML from a sequence of body parts.

Args: parts - sequence of {:content-type string :content string} content-type is checked for "text/plain" and "text/html"

Returns: {:text "..." :html "..."} — either or both may be nil

Extract plain text and HTML from a sequence of body parts.

Args:
  parts - sequence of {:content-type string :content string}
          content-type is checked for "text/plain" and "text/html"

Returns:
  {:text "..." :html "..."} — either or both may be nil
sourceraw docstring

filter-by-dateclj

(filter-by-date messages since-inst)

Keep only messages received at or after since-inst.

Args: messages - seq of InboundMessage maps since-inst - java.util.Date or inst?

Returns: Filtered vector

Keep only messages received at or after since-inst.

Args:
  messages   - seq of InboundMessage maps
  since-inst - java.util.Date or inst?

Returns:
  Filtered vector
sourceraw docstring

filter-unreadclj

(filter-unread messages)

Keep only messages with :seen? false or absent.

Args: messages - seq of InboundMessage maps

Returns: Filtered vector

Keep only messages with :seen? false or absent.

Args:
  messages - seq of InboundMessage maps

Returns:
  Filtered vector
sourceraw docstring

message-summaryclj

(message-summary msg)

Return a concise summary of a single InboundMessage.

Returns: {:uid :from :subject :received-at :seen?}

Return a concise summary of a single InboundMessage.

Returns:
  {:uid :from :subject :received-at :seen?}
sourceraw docstring

parse-message-headersclj

(parse-message-headers header-map)

Convert a string-keyed header map to kebab-case keyword keys.

Args: header-map - map of {"Header-Name" "value"}

Returns: map of {:header-name "value"}

Convert a string-keyed header map to kebab-case keyword keys.

Args:
  header-map - map of {"Header-Name" "value"}

Returns:
  map of {:header-name "value"}
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close