create-smart-mailbox
Create a criteria-based smart mailbox in Apple Mail to filter emails by sender, subject, or body content.
Instructions
Use when: creating an Apple Mail smart mailbox (a criteria-based virtual view) that matches a sender, subject, or body substring — works on German-localized macOS where AppleScript's smart-mailbox terms fail. Returns: confirmation of creation, or a note that a smart mailbox with that name already existed. Do not use when: creating a real folder (use create-mailbox). Safety: edits Apple Mail's SyncedSmartMailboxes.plist directly. It backs the file up (.bak) and writes atomically, and never rewrites your existing smart mailboxes. It does not quit Mail — quit Mail first for reliable results, since a running Mail may not show the new smart mailbox until relaunched and can overwrite plist edits it did not make.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| bodyContains | No | Match body (contains) | |
| fromContains | No | Match sender (From contains) | |
| subjectContains | No | Match subject (contains) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| name | No | ||
| alreadyExisted | No |