IMAP folder operations: list, open, close, and query folders.
IMAP folder operations: list, open, close, and query folders.
(close-folder folder)Close a folder. Never expunges (this library is read-only).
Close a folder. Never expunges (this library is read-only).
(list-folders {:keys [store]})List all folders on the server. Returns a vector of maps with keys: :name, :full-name, :type (:holds-messages, :holds-folders, :holds-both), :message-count, :unread-count.
Example: (list-folders conn)
List all folders on the server. Returns a vector of maps with keys: :name, :full-name, :type (:holds-messages, :holds-folders, :holds-both), :message-count, :unread-count. Example: (list-folders conn)
(message-count conn folder-name)Return the number of messages in the named folder.
Return the number of messages in the named folder.
(open-folder {:keys [store]} folder-name)Open a folder by name in read-only mode. Returns a jakarta.mail.Folder.
Example: (open-folder conn "INBOX")
Open a folder by name in read-only mode. Returns a jakarta.mail.Folder. Example: (open-folder conn "INBOX")
(uid-next conn folder-name)Return the folder's UIDNEXT (the UID the next new message will receive), or -1 if the server does not report it.
Useful for diagnosing a stuck watermark: if a caller's stored UID is greater than UIDNEXT, UIDVALIDITY has almost certainly changed.
Return the folder's UIDNEXT (the UID the next new message will receive), or -1 if the server does not report it. Useful for diagnosing a stuck watermark: if a caller's stored UID is greater than UIDNEXT, UIDVALIDITY has almost certainly changed.
(uid-validity conn folder-name)Return the UIDVALIDITY of the named folder as a long.
UIDVALIDITY is assigned by the server (RFC 3501) and changes when the mailbox's UID space is no longer valid — for example after a mailbox recreation or a server migration. Callers persisting UIDs as watermarks must persist UIDVALIDITY alongside and discard the watermark when the value has changed, otherwise a stale watermark can silently skip every new message.
Return the UIDVALIDITY of the named folder as a long. UIDVALIDITY is assigned by the server (RFC 3501) and changes when the mailbox's UID space is no longer valid — for example after a mailbox recreation or a server migration. Callers persisting UIDs as watermarks must persist UIDVALIDITY alongside and discard the watermark when the value has changed, otherwise a stale watermark can silently skip every new message.
(unread-count conn folder-name)Return the number of unread messages in the named folder.
Return the number of unread messages in the named folder.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |