flag_email
Mark or unmark an iCloud email as flagged to highlight important messages for follow-up or organization within your mailbox.
Instructions
Flag or unflag a single email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Email UID | |
| flagged | Yes | True to flag, false to unflag | |
| mailbox | No | Mailbox name (default INBOX) |
Implementation Reference
- lib/imap.js:1532-1543 (handler)The 'flagEmail' tool implementation which adds or removes the '\\Flagged' flag from a specific email by UID.
export async function flagEmail(uid, flagged, mailbox = 'INBOX', creds = null) { const client = createRateLimitedClient(creds); await client.connect(); await client.mailboxOpen(mailbox); if (flagged) { await client.messageFlagsAdd(uid, ['\\Flagged'], { uid: true }); } else { await client.messageFlagsRemove(uid, ['\\Flagged'], { uid: true }); } await client.logout(); return true; }