Skip to content

Capabilities ​

The capability interfaces of Mailbox, in dev.reapermaga.mailkt.client.

Mailbox ​

MemberDescription
id: MailboxIdProvider plus canonical address.
email: MailAddressThe opened address.
state: StateFlow<MailboxState>Authoritative lifecycle state.
events: Flow<MailboxEvent>Bounded best-effort diagnostics.
folders: FoldersFolder operations.
messages: MessagesReading and watching.
conversations: ConversationsThreading.
outbox: Outbox?Sending, or null without SMTP.
suspend reconnect()Resume after re-authorization or from a recoverable Failed.
suspend close()Idempotent close.
suspend Mailbox.use { }Runs a block and always closes.

Folders ​

FunctionReturnsDescription
list()List<FolderInfo>All folders.
special(use)FolderInfo?Folder by special-use attribute.
append(folder, draft, flags)MessageLocation?Stores a message; location when the server reports it.

Messages ​

FunctionReturnsDescription
page(selection, limit = 50)EnvelopePageOne page; pass page.next back to continue.
envelopes(selection)Flow<MessageEnvelope>Frozen snapshot stream.
messages(selection, maxBytesPerMessage)Flow<MailMessage>Full messages; envelope filtering first.
envelope(location)MessageEnvelopeOne envelope.
structure(location)MessageStructureMIME tree without content.
download(ref, maxBytes)DownloadedPartOne part; limit is mandatory.
get(location, maxBytes)MailMessageOne complete message.
watchEnvelopes(folder, query, from)Flow<WatchedEnvelope>Live envelopes with catch-up.
watch(folder, query, from, maxBytesPerMessage)Flow<WatchedMessage>Live full messages with catch-up.

Messages.DEFAULT_MAX_BYTES is 25 MiB. WatchedEnvelope and WatchedMessage pair the item with its next: WatchCheckpoint.

Conversations ​

FunctionReturnsDescription
of(location, maxMessages = 200)ConversationConversation containing a message, merged across copies.
synchronize(folder, from, maxMessages = 500, query)ConversationSyncIncremental changes and next checkpoint.
assemble(envelopes)List<Conversation>Offline grouping, no server contact.

Outbox ​

FunctionReturnsDescription
newDraft()DraftEmpty draft with from and messageId set.
reply(original, replyAll = false, text)DraftReply with recipients, subject and threading headers.
send(draft, saveToSent = true)SendResultSubmits once; never retried.

Released under the MIT License.