sort_inbox
Sort incoming email by sender using customizable rules. Supports dry-run preview, batch processing, and automatic folder creation.
Instructions
Sort inbox emails into folders by sender using IMAP (fast, for Proton Bridge).
Reads sorting rules from ~/.config/apple-mail-mcp/sort_rules.json. Each rule maps a sender pattern to a destination folder.
Writes real-time progress to /tmp/apple-mail-mcp-sort.log (tail -f to monitor).
Supports batch processing: set batch_size to move N emails per call. Call repeatedly until inbox is clean — already-moved emails are skipped.
Requires config: ~/.config/apple-mail-mcp/imap.json
Args: dry_run: If True, only show what would happen without moving (default: True) max_emails: Maximum emails to scan (0 = all) batch_size: Max emails to move per call (0 = all matched). Use 100-200 to avoid timeouts. rules_path: Optional custom path to sort_rules.json create_folders: Auto-create destination folders that don't exist (default: True)
Returns: Summary of emails scanned, matched, and moved
User Preferences: {"workflow": "default", "notifications": "enabled"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| batch_size | No | ||
| max_emails | No | ||
| rules_path | No | ||
| create_folders | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |