Skip to main content

STATUS

This function requests status information about a folder without selecting it.

Usage

let status = await imap.status("INBOX")

// Only request specific items
let minimal = await imap.status("INBOX", ["MESSAGES", "UNSEEN"])
let deleted = await imap.status("INBOX", ["MESSAGES", "DELETED", "SIZE"])

By default all of the following items are requested: MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN.

The supported items are MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN (IMAP4rev1) plus DELETED and SIZE (added in RFC 9051 §6.3.11).

Response

Returns a Record<string, number> with lowercased keys:

{
messages: 78,
recent: 0,
uidnext: 92,
uidvalidity: 1687639849,
unseen: 23
}