apple-mail-mcp 2.8.16 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +61 -0
  2. package/build/index.js +790 -167
  3. package/package.json +1 -5
package/README.md CHANGED
@@ -879,6 +879,67 @@ Rename a mailbox (creates new, moves messages, deletes old).
879
879
 
880
880
  ---
881
881
 
882
+ ### Smart Mailbox Operations (intelligente Postfächer)
883
+
884
+ Smart mailboxes are Apple Mail's **criteria-based virtual views** — not real folders, so no messages are moved. AppleScript's `smart mailbox` / `intelligentes Postfach` terms don't compile reliably on localized (e.g. German) macOS, so these tools read and edit `~/Library/Mail/V*/MailData/SyncedSmartMailboxes.plist` directly.
885
+
886
+ **How writes stay safe:** creating or deleting a smart mailbox first backs the plist up to `SyncedSmartMailboxes.plist.bak`, edits a temp copy with `plutil`/`PlistBuddy`, validates it with `plutil -lint`, and only then atomically renames it into place. Your **existing** smart mailboxes — including any with date/data criteria — are never rewritten, only the single target entry is added or removed. These tools do **not** quit or restart Mail: **quit Mail first** for reliable results, since a running Mail may not show a new smart mailbox until it's relaunched and can overwrite plist edits it didn't make.
887
+
888
+ #### `list-smart-mailboxes`
889
+
890
+ List existing smart mailboxes.
891
+
892
+ **Parameters:** None
893
+
894
+ **Returns:** List of smart mailbox names + criteria summary.
895
+
896
+ ---
897
+
898
+ #### `create-smart-mailbox`
899
+
900
+ Create a smart mailbox with a simple contains rule.
901
+
902
+ | Parameter | Type | Required | Description |
903
+ |-----------|------|----------|-------------|
904
+ | `name` | string | Yes | Name for the smart mailbox |
905
+ | `fromContains` | string | No | Match if From contains this |
906
+ | `subjectContains` | string | No | Match if Subject contains this |
907
+ | `bodyContains` | string | No | Match if Body contains this |
908
+
909
+ Provide at least one of the three `*Contains` fields.
910
+
911
+ **⚠️ Safety:** edits `SyncedSmartMailboxes.plist` (backed up + atomic, existing smart mailboxes preserved). Quit Mail first for reliable results; the new smart mailbox appears the next time Mail launches.
912
+
913
+ ---
914
+
915
+ #### `delete-smart-mailbox`
916
+
917
+ Delete a smart mailbox by name.
918
+
919
+ | Parameter | Type | Required | Description |
920
+ |-----------|------|----------|-------------|
921
+ | `name` | string | Yes | Smart mailbox name |
922
+
923
+ **⚠️ Safety:** destructive — removes the smart mailbox from `SyncedSmartMailboxes.plist` (backed up + atomic; every other smart mailbox is preserved). Not undoable in-app. Confirm the exact name with `list-smart-mailboxes` first, and quit Mail first for reliable results.
924
+
925
+ ---
926
+
927
+ #### `create-newsletter-smart-mailboxes`
928
+
929
+ High-level tool: scan recent messages in your INBOXes, detect likely newsletters (volume + signals like List-Unsubscribe, noreply, repetitive subjects), and create smart mailboxes for them (names prefixed "NL: ...").
930
+
931
+ | Parameter | Type | Required | Description |
932
+ |-----------|------|----------|-------------|
933
+ | `dryRun` | boolean | No | Default true — only propose, do not create |
934
+ | `minCount` | number | No | Min messages from a sender (default 3) |
935
+ | `days` | number | No | Lookback window in days (default 90) |
936
+
937
+ Defaults to a **safe dry run** that only proposes. Pass `dryRun: false` to actually create the smart mailboxes for newsletters cluttering your Inbox.
938
+
939
+ **⚠️ Safety:** with `dryRun: false` this edits `SyncedSmartMailboxes.plist` (backed up + atomic, existing entries preserved) and can create many smart mailboxes at once — review a dry run first. Scans up to ~400 recent messages per inbox via AppleScript, which can be slow on large mailboxes.
940
+
941
+ ---
942
+
882
943
  ### Account Operations
883
944
 
884
945
  #### `list-accounts`