imap_check_spam
Check a mail folder for spam by analyzing sender domains and email headers, detecting bulk mailers, authentication failures, and mismatched reply-to domains.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Filter by sender (optional) | |
| limit | No | Maximum number of emails to check | |
| since | No | Check emails since date (YYYY-MM-DD) | |
| folder | No | Folder name | INBOX |
| accountId | Yes | Account ID | |
| includeHeaderChecks | No | Also 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 message headers in one extra batch round-trip. Set false to skip header analysis and only check sender domains. |