imap_bulk_delete_by_search
Search and delete emails by sender, subject, or date range to clean up unwanted messages.
Instructions
Search for emails matching criteria and delete them all. Useful for cleaning up spam or unwanted emails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Delete emails to this recipient | |
| from | No | Delete emails from this sender | |
| since | No | Delete emails since this date (YYYY-MM-DD) | |
| before | No | Delete emails before this date (YYYY-MM-DD) | |
| dryRun | No | If true, only return what would be deleted without actually deleting | |
| folder | No | Folder name | INBOX |
| subject | No | Delete emails with this subject | |
| accountId | No | Account ID (from imap_list_accounts). Optional if accountName is given or only one account is configured. | |
| chunkSize | No | Number of emails to delete per batch | |
| accountName | No | Account name instead of accountId. Optional if accountId is given or only one account is configured. |