imap-mcp-server

v2.2.0
io.github.nikolausm/imap-mcp-server Checked 5 hours ago Published 1 month ago

IMAP/SMTP MCP server to search, read, organize, send, reply & forward email for AI assistants

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

imap_add_account

Add a new IMAP account configuration

ParameterTypeDescription
host *stringIMAP server hostname
name *stringFriendly name for the account
password *stringPassword for authentication
user *stringUsername for authentication
allowStartTLSbooleanWhen tls is false, imapflow still opportunistically upgrades via STARTTLS if the server advertises it, validating the cert against `host` regardless of `tls`. Set to false to disable that upgrade and…
allowedFromarrayAdditional sender identities allowed in the From header. The account email and login are always allowed.
defaultBccOptional BCC address(es) applied automatically to every outbound send, reply, forward, and draft for this account. Merged with any per-call bcc
emailstringEmail address (From: header). Defaults to user if omitted
portnumberIMAP server port (default: 993)
sentFolderstringExplicit Sent-folder name for saving sent-mail copies (e.g. "Gesendet"). Only needed when auto-detection fails — the server must lack a \Sent SPECIAL-USE folder. Check names with imap_list_folders
smtpHoststringSMTP server hostname. Defaults to IMAP host with imap.→smtp. rewrite
smtpPortnumberSMTP server port (465 for SMTPS, 587 for STARTTLS). Defaults to 587
smtpSecurebooleanUse implicit TLS (SMTPS). Ignored for port 587/25 which always use STARTTLS, and for port 465 which always uses implicit TLS
tlsbooleanUse TLS/SSL (default: true)

imap_update_account

Update an existing IMAP account. Useful for fixing SMTP settings without removing and re-adding the account.

ParameterTypeDescription
accountId *stringID of the account to update
allowStartTLSbooleanWhen tls is false, set to false to also disable imapflow's opportunistic STARTTLS upgrade (see imap_add_account). Defaults to true.
allowedFromarrayAdditional sender identities allowed in the From header. Pass an empty array to clear.
defaultBccOptional BCC address(es) applied automatically to every outbound message for this account. Pass an empty string to clear
emailstringEmail address (From: header)
hoststringIMAP host
namestringNew friendly name
passwordstringNew password
portnumberIMAP port
saveToSentbooleanSave sent emails to the Sent folder
sentFolderstringExplicit Sent-folder name for saving sent-mail copies (e.g. "Gesendet"). Overrides auto-detection; pass an empty string to clear the override and re-enable auto-detection. Check names with imap_list_f…
smtpHoststringSMTP hostname
smtpPasswordstringSMTP password (if different from IMAP password)
smtpPortnumberSMTP port (465 for SMTPS, 587 for STARTTLS)
smtpSecurebooleanUse implicit TLS (SMTPS). Port 587/25 always use STARTTLS regardless
smtpUserstringSMTP username (if different from IMAP user)
tlsbooleanUse TLS for IMAP
userstringIMAP username

imap_list_accounts

List all configured IMAP accounts

imap_remove_account

Remove an IMAP account configuration

ParameterTypeDescription
accountId *stringID of the account to remove

imap_connect

Connect to an IMAP account

ParameterTypeDescription
accountIdstringAccount ID to connect to
accountNamestringAccount name to connect to

imap_disconnect

Disconnect from an IMAP account

ParameterTypeDescription
accountId *stringAccount ID to disconnect from

imap_test_account

Test an existing account connection without re-entering credentials. Validates IMAP connectivity and returns folder count and message count.

ParameterTypeDescription
accountId *stringAccount ID to test

imap_search_emails

Note: on some servers a 'flagged' or starred message carries a custom keyword (e.g. an Open-Xchange color label or Apple's $MailFlagBit*) instead of, or in addition to, the \Flagged system flag. After any flagged search, inspect each result's customKeywords field before concluding a message is or isn't flagged — do not rely on the flagged filter alone. Search for emails matching criteria (sender, recipient, subject, body text, date range, read/flagged status). Use this to FIND messages when you know something about them but not their UID — e.g. "emails from amazon last week", "unread invoi…

ParameterTypeDescription
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
beforestringSearch emails before date (YYYY-MM-DD)
bodystringSearch in body text
bodyFormatstringHow to render the body when `includeBody` is true. Mirrors `imap_get_email` — "markdown" (default) returns clean Markdown and omits raw HTML so it never crosses the MCP boundary; "text" returns plai…
bodyMaxLengthnumberPer-message cap (in characters) for each rendered body field when `includeBody` is true. Defaults to 10000 to match `imap_get_email`.
flaggedbooleanFilter by flagged status
folderstringFolder name to search (default: INBOX). Ignored when searchAllFolders is true.
fromstringSearch by sender
includeBodybooleanIf true, also fetch the parsed message body in the same round-trip and return it alongside headers (avoids the N+1 cost of calling imap_get_email per match). Body is rendered per `bodyFormat` and capp…
includeDraftsbooleanWhen searchAllFolders is true, also search the Drafts folder (off by default).
includeSpambooleanWhen searchAllFolders is true, also search Spam/Junk folders (off by default — noisy).
includeTrashbooleanWhen searchAllFolders is true, also search Trash/Bin/Deleted folders (off by default — noisy).
keywordsarrayMatch messages that have ANY of these CUSTOM keywords (server-side OR; not system flags like \Seen/\Flagged). Read a mailbox's available custom keywords from imap_folder_status's customKeywords field,…
limitnumberMaximum number of results
messageIdstringSearch by RFC822 Message-ID header (substring match)
searchAllFoldersbooleanSearch across ALL folders instead of just `folder`. Skips Trash/Spam/Drafts and non-selectable folders by default. Use when a message might have been filed/archived/moved and you do not know which fol…
seenbooleanFilter by read/unread status
sincestringSearch emails since date (YYYY-MM-DD)
subjectstringSearch by subject
tostringSearch by recipient
unKeywordsarrayExclude messages that have ANY of these CUSTOM keywords (server-side; result has NONE of them). Same keyword source as `keywords` — check imap_folder_status first.

imap_get_email

Read the FULL content of a single email by its UID (body, sender/recipients, date, attachment list, optional raw headers and text-attachment previews). By default the body is returned as clean Markdown in markdownContent and raw HTML is omitted so it never crosses the boundary; set bodyFormat to "html" for the legacy raw htmlContent, or "text" for plain text only. Use after imap_search_emails or imap_get_latest_emails gives you a uid. Body text is truncated to maxContentLength to protect the context window — raise it for long messages. To fetch attachment bytes, use imap_download_attachment.

ParameterTypeDescription
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
bodyFormatstringHow to return the body. "markdown" (default): clean Markdown via Turndown in markdownContent, raw htmlContent omitted so HTML never crosses the boundary. "text": plain text only in textContent. "html"…
folderstringFolder name
includeAttachmentTextbooleanInclude text attachment previews when available
includeHeadersbooleanInclude raw email headers (e.g. List-Unsubscribe, List-Unsubscribe-Post)
maxAttachmentTextCharsnumberMaximum characters to return per text attachment
maxContentLengthnumberMaximum characters to return for each body field (text/markdown/html)

imap_upload_file

Upload a file to the server for use as an email attachment. Returns a path that can be used with imap_send_email attachments. This allows sending large attachments without hitting context window limits. Max size: 26214400 bytes (configurable via IMAP_MAX_UPLOAD_SIZE). Uploads are auto-deleted after 86400000 ms (configurable via IMAP_UPLOAD_TTL_MS).

ParameterTypeDescription
content *stringBase64 encoded file content
filename *stringFilename to save as
contentTypestringMIME type (optional, used for metadata only)

imap_download_attachment

Download a single attachment from an email (folder + uid + attachment filename/contentId, as listed by imap_get_email). Images are returned inline for viewing; PDFs are saved and their text is extracted inline (extractText); other files are saved to the shared downloads directory (or savePath). Use when the user wants the actual file contents, not just the message body.

ParameterTypeDescription
filename *stringAttachment filename or contentId as listed by imap_get_email. Matched exactly first, then Unicode-normalized (NFC/NFD spellings of umlauts and accents are treated as equal); a contentId may be given w…
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
extractTextbooleanFor PDFs, extract and return text content inline
folderstringFolder name
savePathstringOptional file path to save the attachment to. If not provided, files are saved to the shared downloads directory.

imap_mark_as_read

Mark one or many emails as read. Accepts a single UID or an array — pass an array to flag N messages in one IMAP STORE round-trip (useful when triaging).

ParameterTypeDescription
uid *Email UID, or array of UIDs to mark as read in one call (avoids N round-trips when triaging). All listed UIDs share the same IMAP STORE command, so the operation is atomic at the server level.
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_mark_as_unread

Mark one or many emails as unread. Accepts a single UID or an array — pass an array to flag N messages in one IMAP STORE round-trip.

ParameterTypeDescription
uid *Email UID, or array of UIDs to mark as unread in one call (avoids N round-trips when triaging). All listed UIDs share the same IMAP STORE command, so the operation is atomic at the server level.
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_flag_email

Flag an email — sets the IMAP \Flagged system flag (shows as a star in Gmail / a flag in Apple Mail). Use this tool when a user asks to star, flag, or mark a message as important.

ParameterTypeDescription
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_unflag_email

Unflag an email — removes the IMAP \Flagged system flag (the star in Gmail, the flag in Apple Mail). Note: some servers (e.g. Open-Xchange / Network Solutions) and Apple Mail also write a separate custom keyword such as $cl_N or $MailFlagBit* when a message is flagged in their client. Removing \Flagged alone does not clear that keyword, so the message may still display as flagged. If it does, check the message's customKeywords via imap_get_email and remove the lingering label with imap_remove_keyword.

ParameterTypeDescription
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_add_keyword

Set an arbitrary custom (non-system) IMAP keyword/label on an email — e.g. a provider color label like Open-Xchange's $cl_1..$cl_10, Apple Mail's $MailFlagBit0..$MailFlagBit2, or an app tag such as $promotion. Unlike imap_flag_email (which only ever sets the system \Flagged flag), this passes the keyword through verbatim, but rejects backslash-prefixed system flags (e.g. \Flagged, \Seen, \Deleted) — use the dedicated flag/read tools for those. Not every IMAP server permits custom keywords (see the mailbox's PERMANENTFLAGS) — if the server rejects or silently ignores the change, this call…

ParameterTypeDescription
keyword *stringIMAP keyword to set, passed through verbatim (e.g. "$cl_3", "$MailFlagBit0", "$Junk")
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_remove_keyword

Remove an arbitrary custom (non-system) IMAP keyword/label from an email — e.g. a provider color label like Open-Xchange's $cl_1..$cl_10, Apple Mail's $MailFlagBit0..$MailFlagBit2, or an app tag such as $promotion. Unlike imap_unflag_email (which only ever clears the system \Flagged flag), this passes the keyword through verbatim, but rejects backslash-prefixed system flags (e.g. \Flagged, \Seen, \Deleted) — use the dedicated flag/read tools for those. Not every IMAP server permits custom keywords (see the mailbox's PERMANENTFLAGS) — if the server rejects or silently ignores the change,…

ParameterTypeDescription
keyword *stringIMAP keyword to remove, passed through verbatim (e.g. "$cl_3", "$MailFlagBit0", "$Junk")
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_delete_email

Delete ONE email by folder + uid (moves to Trash or expunges, server-dependent). Destructive and not easily undone — confirm the user means this specific message. To remove many at once use imap_bulk_delete (known uids) or imap_bulk_delete_by_search (by criteria, supports dryRun). To file an email away instead of deleting, use imap_move_email.

ParameterTypeDescription
uid *numberEmail UID
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
folderstringFolder name

imap_move_email

Move an email from one folder to another (e.g., INBOX to Taxes, or INBOX to Archive). Optionally creates the destination folder if it does not exist.

ParameterTypeDescription
targetFolder *stringDestination folder name
uid *Single email UID or array of UIDs to move in one call. Pass an array when triaging many messages at once (e.g. "move the 10 invoices I just classified to Archive") to avoid N round-trips.
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
createDestinationIfMissingbooleanIf true, create the destination folder before moving when it does not exist (default: false)
folderstringSource folder name

imap_bulk_delete

Delete multiple emails at once with chunking and auto-reconnection. Processes deletions in batches to prevent connection timeouts.

ParameterTypeDescription
uids *arrayArray of email UIDs to delete
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
chunkSizenumberNumber of emails to delete per batch (default: 50)
folderstringFolder name

imap_get_latest_emails

Get the most recent emails from a folder, newest first. Use this for "what just came in?" / "show my latest inbox messages" when no search filter is needed. By default returns lightweight headers (uid, from, subject, date); set `includeBody=true` to also return the parsed body in one round-trip instead of paying the N+1 cost of calling imap_get_email per message. To filter by sender/subject/date instead, use imap_search_emails.

ParameterTypeDescription
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
bodyFormatstringHow to render the body when `includeBody` is true. Mirrors `imap_get_email` — "markdown" (default) returns clean Markdown; "text" returns plain text; "html" returns raw HTML; "auto" prefers substant…
bodyMaxLengthnumberPer-message cap (in characters) for each rendered body field when `includeBody` is true. Defaults to 10000 to match `imap_get_email`.
countnumberNumber of emails to retrieve
folderstringFolder name
includeBodybooleanIf true, also fetch the parsed message body in the same round-trip and return it alongside headers (avoids the N+1 cost of calling imap_get_email per message). Body is rendered per `bodyFormat` and ca…

imap_send_email

Compose and send a NEW email via the account's SMTP server (a copy is saved to Sent unless disabled; account defaultBcc addresses are always BCC'd when configured). Use for fresh outbound messages. To respond to an existing message use imap_reply_to_email (keeps threading); to pass a message on use imap_forward_email; to store without sending use imap_save_draft. Supports to/cc/bcc, text and/or HTML, and attachments by base64 content or by file path (see imap_upload_file for large files).

ParameterTypeDescription
subject *stringEmail subject
to *Recipient email address(es). Either an array of addresses or a single comma-separated string; both accept "Name <addr@example.com>" form.
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
attachmentsarrayEmail attachments
bccBCC recipients. Either an array of addresses or a single comma-separated string; merged with the account defaultBcc when set.
bodystringAlias for 'text' (backward-compat with clients that pass 'body')
ccCC recipients. Either an array of addresses or a single comma-separated string.
dryRunbooleanValidate attachments and compose MIME without sending SMTP mail or saving a Sent copy. Use to diagnose attachment payloads safely before sending.
fromstringSender identity. Must match the account email/login or an address configured in allowedFrom.
htmlstringHTML content
replyTostringReply-to address
textstringPlain text content

imap_save_draft

Save an email as a draft in the Drafts folder (no send). Takes the same fields as imap_send_email (including account defaultBcc when configured).

ParameterTypeDescription
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
attachmentsarrayEmail attachments
bccBCC recipients. Either an array of addresses or a single comma-separated string; merged with the account defaultBcc when set.
bodystringAlias for 'text' (backward-compat)
ccCC recipients. Either an array of addresses or a single comma-separated string.
folderstringOverride the Drafts folder name (defaults to auto-detected Drafts folder)
fromstringSender identity. Must match the account email/login or an address configured in allowedFrom.
htmlstringHTML content
inReplyTostringMessage-Id being replied to
referencesReferences header value(s)
replyTostringReply-to address
subjectstringEmail subject
textstringPlain text content
toRecipient email address(es). Either an array of addresses or a single comma-separated string.

imap_reply_to_email

Reply to an existing email identified by folder + uid. Automatically sets the recipient to the original sender, prefixes the subject with "Re:", and preserves threading (In-Reply-To/References). Set replyAll to also include the original To (and Cc as Cc), excluding the account's own address; a Reply-To header on the original is honoured. Use this instead of imap_send_email whenever the user is responding to a message already in a mailbox. Account defaultBcc addresses are always BCC'd when configured.

ParameterTypeDescription
uid *numberUID of the email to reply to
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
attachmentsarrayEmail attachments
bccBCC recipients. Either an array of addresses or a single comma-separated string; merged with the account defaultBcc when set.
bodystringAlias for 'text' (backward-compat)
folderstringFolder containing the original email
fromstringSender identity. Must match the account email/login or an address configured in allowedFrom.
htmlstringHTML reply content
replyAllbooleanReply to all recipients
textstringPlain text reply content

imap_forward_email

Forward an existing email (folder + uid) to new recipients, quoting the original message and headers. Optionally include the original attachments. Use when the user wants to pass an existing message on to someone else; use imap_reply_to_email instead to respond to the sender. Account defaultBcc addresses are always BCC'd when configured.

ParameterTypeDescription
to *Forward to email address(es). Either an array of addresses or a single comma-separated string.
uid *numberUID of the email to forward
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
bccBCC recipients. Either an array of addresses or a single comma-separated string; merged with the account defaultBcc when set.
bodystringAlias for 'text' (backward-compat)
folderstringFolder containing the original email
fromstringSender identity. Must match the account email/login or an address configured in allowedFrom.
includeAttachmentsbooleanInclude original attachments
textstringAdditional text to include

imap_find_thread_messages

Find messages in `searchFolder` that belong to the same conversation threads as messages already in `sourceFolder`. Useful for catching replies that arrived after a thread was sorted. Works on any IMAP server (uses RFC 3501 HEADER search on In-Reply-To and References). Set `includeBody=true` to also return the parsed body for each found thread message in one round-trip — avoids the N+1 cost of calling imap_get_email per thread member.

ParameterTypeDescription
sourceFolder *stringFolder containing the already-sorted thread messages (e.g. "Review.Articles")
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
bodyFormatstringHow to render the body when `includeBody` is true. Mirrors `imap_get_email` — "markdown" (default) returns clean Markdown; "text" returns plain text; "html" returns raw HTML; "auto" prefers substant…
bodyMaxLengthnumberPer-message cap (in characters) for each rendered body field when `includeBody` is true. Defaults to 10000 to match `imap_get_email`.
includeBodybooleanIf true, also fetch the parsed message body for each found thread message in the same round-trip and return it alongside headers (avoids the N+1 cost of calling imap_get_email per thread member). Body…
searchFolderstringFolder to search for related thread messages (default: INBOX)
searchReferencesbooleanAlso search the References header for multi-level threads (default: true)

imap_find_email_by_message_id

Locate an email by its RFC822 Message-ID across folders and return its current { folder, uid } plus basic envelope. Robust to the message having been moved or archived (IMAP UIDs are folder-relative). Pass the returned folder + uid to imap_reply_to_email or imap_get_email. Without `folders`, searches Gmail \All Mail when present, else INBOX → Archive → Sent → remaining folders.

ParameterTypeDescription
accountId *stringAccount ID
messageId *stringRFC822 Message-ID, with or without angle brackets
foldersarrayExplicit folders to search, in order (overrides the default order)

imap_list_folders

List all folders/mailboxes for an account (names, hierarchy delimiter, attributes, RFC 6154 special-use role). Use this first to discover exact folder names before searching, moving, or creating subfolders — folder naming varies by provider (e.g. "Archive" vs "[Gmail]/All Mail" vs "INBOX.Archive"). The specialUse field ("\\Sent", "\\Drafts", "\\Trash", "\\Junk", "\\Archive") identifies a folder's role independent of its localized name (e.g. "Gesendet" is the Sent folder when specialUse is "\\Sent").

ParameterTypeDescription
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.

imap_folder_status

Get status information about a folder

ParameterTypeDescription
folder *stringFolder name
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.

imap_create_folder

Create a new IMAP folder/mailbox. Most servers also create any missing parent folders (e.g. creating "Archives/2026/2026-05" auto-creates "Archives" and "Archives/2026"). Returns success even if the folder already exists.

ParameterTypeDescription
folder *stringFull folder path to create (e.g. "Archives/2026/2026-05" or "INBOX.Archive")
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.

imap_get_unread_count

Count unread (unseen) emails per folder, plus a total. Use for "how many unread do I have?" overviews. Defaults to all folders; pass a folders list to limit scope and speed it up.

ParameterTypeDescription
accountIdstringAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNamestringAccount name instead of accountId. Optional if accountId is given or only one account is configured.
foldersarrayList of folders to check (default: all)

imap_check_spam

Check emails in a folder for spam. Combines sender-domain checks (known spam/disposable domains, suspicious patterns) with deterministic raw-header analysis: bulk-mailer X-Mailer/User-Agent signatures, Precedence: bulk, DMARC/SPF/DKIM failures in Authentication-Results, and List-Unsubscribe / Reply-To domains that do not match the sender. Header checks catch scam mail from fresh, unlisted domains that pass the domain check. Returns domain-based spam, a separate list of header-flagged mails, and domain statistics.

ParameterTypeDescription
accountId *stringAccount ID
folderstringFolder name
fromstringFilter by sender (optional)
includeHeaderChecksbooleanAlso run deterministic raw-header checks (X-Mailer bulk tools, Precedence: bulk, DMARC/SPF/DKIM failures, List-Unsubscribe/Reply-To domain mismatches) on top of the sender-domain check. Fetches messag…
limitnumberMaximum number of emails to check
sincestringCheck emails since date (YYYY-MM-DD)

imap_delete_spam

Find and delete emails from known spam/disposable email domains.

ParameterTypeDescription
accountId *stringAccount ID
dryRunbooleanIf true, only report what would be deleted without deleting
folderstringFolder name
limitnumberMaximum number of emails to check
minConfidencestringMinimum confidence level for spam detection

imap_domain_stats

Get statistics about sender domains in a folder. Useful for identifying bulk senders or spam patterns.

ParameterTypeDescription
accountId *stringAccount ID
folderstringFolder name
limitnumberMaximum number of emails to analyze
minCountnumberMinimum email count per domain to include

imap_add_spam_domain

Add a domain to the custom spam list. Emails from this domain will be flagged as spam.

ParameterTypeDescription
domain *stringDomain to add to spam list (e.g., "spammer.com")

imap_remove_spam_domain

Remove a domain from the custom spam list.

ParameterTypeDescription
domain *stringDomain to remove from spam list

imap_add_whitelist_domain

Add a domain to the whitelist. Emails from whitelisted domains will never be flagged as spam.

ParameterTypeDescription
domain *stringDomain to whitelist (e.g., "trusted.com")

imap_list_spam_domains

List all known spam domains (built-in and custom).

imap_delete_by_domain

Delete all emails from a specific domain. Useful for cleaning up unwanted newsletters or spam.

ParameterTypeDescription
accountId *stringAccount ID
domain *stringDomain to delete emails from (e.g., "spammer.com")
dryRunbooleanIf true, only report what would be deleted
folderstringFolder name