mark_as_read
Mark iCloud Mail emails as read or unread to manage your inbox status. Specify email UID and desired read/unread state for precise email organization.
Instructions
Mark a single email as read or unread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Email UID | |
| seen | Yes | True to mark as read, false for unread | |
| mailbox | No | Mailbox name (default INBOX) |
Implementation Reference
- lib/imap.js:1545-1556 (handler)Implementation of the mark_as_read handler function in lib/imap.js.
export async function markAsRead(uid, seen, mailbox = 'INBOX', creds = null) { const client = createRateLimitedClient(creds); await client.connect(); await client.mailboxOpen(mailbox); if (seen) { await client.messageFlagsAdd(uid, ['\\Seen'], { uid: true }); } else { await client.messageFlagsRemove(uid, ['\\Seen'], { uid: true }); } await client.logout(); return true; }