proton-mail-bridge-client 2.14.0 → 2.15.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.
- package/README.md +33 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +13 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/scripts/install-claude-desktop.d.ts +2 -0
- package/dist/scripts/install-claude-desktop.d.ts.map +1 -1
- package/dist/scripts/install-claude-desktop.js +59 -17
- package/dist/scripts/install-claude-desktop.js.map +1 -1
- package/dist/services/account-manager.d.ts +2 -0
- package/dist/services/account-manager.d.ts.map +1 -1
- package/dist/services/account-manager.js +14 -2
- package/dist/services/account-manager.js.map +1 -1
- package/dist/services/background-sync-service.d.ts +3 -3
- package/dist/services/background-sync-service.d.ts.map +1 -1
- package/dist/services/background-sync-service.js +6 -6
- package/dist/services/background-sync-service.js.map +1 -1
- package/dist/services/rules-service.d.ts +174 -0
- package/dist/services/rules-service.d.ts.map +1 -0
- package/dist/services/rules-service.js +450 -0
- package/dist/services/rules-service.js.map +1 -0
- package/dist/services/simple-imap-service.d.ts +1 -0
- package/dist/services/simple-imap-service.d.ts.map +1 -1
- package/dist/services/simple-imap-service.js +22 -0
- package/dist/services/simple-imap-service.js.map +1 -1
- package/dist/tools/bulk.d.ts +1 -0
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +26 -1
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/definitions.d.ts +225 -0
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +97 -0
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/diagnostics.d.ts.map +1 -1
- package/dist/tools/diagnostics.js +7 -1
- package/dist/tools/diagnostics.js.map +1 -1
- package/dist/tools/folders.d.ts.map +1 -1
- package/dist/tools/folders.js +20 -5
- package/dist/tools/folders.js.map +1 -1
- package/dist/tools/merge.d.ts +2 -0
- package/dist/tools/merge.d.ts.map +1 -1
- package/dist/tools/merge.js +5 -1
- package/dist/tools/merge.js.map +1 -1
- package/dist/tools/message-actions.d.ts.map +1 -1
- package/dist/tools/message-actions.js +42 -10
- package/dist/tools/message-actions.js.map +1 -1
- package/dist/tools/reading.d.ts.map +1 -1
- package/dist/tools/reading.js +19 -3
- package/dist/tools/reading.js.map +1 -1
- package/dist/tools/rules-runner.d.ts +40 -0
- package/dist/tools/rules-runner.d.ts.map +1 -0
- package/dist/tools/rules-runner.js +221 -0
- package/dist/tools/rules-runner.js.map +1 -0
- package/dist/tools/rules.d.ts +4 -0
- package/dist/tools/rules.d.ts.map +1 -0
- package/dist/tools/rules.js +128 -0
- package/dist/tools/rules.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
Give Claude Desktop (or Cline, or any MCP client) full access to your Proton Mail inbox: read, search, send, draft, triage threads, manage folders, save attachments, and more —
|
|
27
|
+
Give Claude Desktop (or Cline, or any MCP client) full access to your Proton Mail inbox: read, search, send, draft, triage threads, manage folders, save attachments, and more — 108 MCP tools in total. Most of the same capabilities are also available as a full CLI for scripting, cron, and piped automation — no Claude required.
|
|
28
28
|
|
|
29
29
|
> **Using Proton Drive too?** See [**proton-drive-mcp**](https://github.com/googlarz/proton-drive-mcp), the companion MCP server and CLI for Proton Drive (upload, download, share and manage your encrypted files from Claude). Run both side by side to handle mail and files in one conversation, for example save an attachment from here, then upload it to Drive. More in [Related projects](#related-projects).
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ Give Claude Desktop (or Cline, or any MCP client) full access to your Proton Mai
|
|
|
44
44
|
- "Find the last email from `alice@example.com` and draft a reply for me to review." (nothing is sent until you say so)
|
|
45
45
|
- "Which of my emails have attachments from this month?"
|
|
46
46
|
- "Show me my drafts and tighten the oldest one."
|
|
47
|
-
5. **Optional:** `PROTONMAIL_READ_ONLY=true` to browse without being able to change anything, `PROTONMAIL_TOOL_TIER=core` for a smaller tool set (25 instead of
|
|
47
|
+
5. **Optional:** `PROTONMAIL_READ_ONLY=true` to browse without being able to change anything, `PROTONMAIL_TOOL_TIER=core` for a smaller tool set (25 instead of 108), and more accounts under [Multi-account support](#multi-account-support-v210). More recipes below in [Try it](#try-it-example-claude-prompts).
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
@@ -54,8 +54,9 @@ Give Claude Desktop (or Cline, or any MCP client) full access to your Proton Mai
|
|
|
54
54
|
- **Safety you choose** — `PROTONMAIL_MODE` presets (`read-only`, `drafts`, `assisted`, `full`), a send gate, confirmation for destructive actions, a per-action allowlist, and a [threat model](docs/threat-model.md) that says what is and is not covered
|
|
55
55
|
- **Several addresses at once** — each Proton login (or each address Bridge exposes) is its own isolated account with its own index, drafts and settings
|
|
56
56
|
- **Fast local search** — full-text search across your inbox from a local index that keeps its read state in step with the server
|
|
57
|
+
- **Rules that suggest themselves** — a scan proposes filters and cleanup from your own mail, applies them to existing mail after a preview, and can forward by condition; see [Mailbox rules](#mailbox-rules-suggestions-filters-cleanup-forwarding)
|
|
57
58
|
- **Automatic reply, per address, with rules** — off by default, with a preview of what it would do, draft-for-approval mode and working-hours; see [Autoresponder](#autoresponder-automatic-reply-per-address) (Proton's own auto-reply may be all you need)
|
|
58
|
-
- **Full CLI** — a dedicated command for every one of the
|
|
59
|
+
- **Full CLI** — a dedicated command for every one of the 108 tools (plus a generic `tool <name>` passthrough), scriptable and pipeable; `doctor` checks every account and `report` prints a diagnostic summary for a bug report
|
|
59
60
|
- **Runs where you do** — Claude Desktop bundle, npm, Homebrew, or a [Docker image](#running-in-docker-headless-machines) for a headless machine
|
|
60
61
|
- **Privacy-native** — no third-party email service involved; your mail stays on your machine
|
|
61
62
|
|
|
@@ -296,14 +297,14 @@ Reload the Cline extension after saving. Proton Mail tools will appear in Cline'
|
|
|
296
297
|
For a server with no desktop, next to a headless Bridge. The image installs the published npm package and is published for each release to `ghcr.io/googlarz/proton-mail-bridge-client` (`:<version>` and `:latest`, linux/amd64 and linux/arm64). To build it yourself from this repo:
|
|
297
298
|
|
|
298
299
|
```bash
|
|
299
|
-
docker build -f docker/Dockerfile --build-arg VERSION=2.
|
|
300
|
+
docker build -f docker/Dockerfile --build-arg VERSION=2.15.1 -t proton-mail-bridge-client .
|
|
300
301
|
docker run -i --rm --network host \
|
|
301
302
|
-e PROTONMAIL_USERNAME=you@proton.me -e PROTONMAIL_PASSWORD_FILE=/run/secrets/bridge \
|
|
302
303
|
-v /path/to/bridge-password:/run/secrets/bridge:ro -v bridge-client-data:/data \
|
|
303
304
|
proton-mail-bridge-client
|
|
304
305
|
```
|
|
305
306
|
|
|
306
|
-
`docker run -i` speaks MCP over stdio. The container must reach Bridge's IMAP and SMTP ports (`--network host`, or `--network container:<bridge>` to share Bridge's network). The CLI is in the same image: add `--entrypoint proton-mail-bridge-client` and a command such as `doctor`. If Bridge is reached by a host name (for example `host.docker.internal` or another container), its self-signed certificate fails verification: export it from Bridge and point `PROTONMAIL_TLS_CA_FILE` at it, or list the name in `PROTONMAIL_TLS_INSECURE_HOSTS`. The server has no network transport of its own; reaching it from a remote client needs your own wrapper. The image was checked to build, report its version, run as a non-root user and answer an MCP `initialize
|
|
307
|
+
`docker run -i` speaks MCP over stdio. The container must reach Bridge's IMAP and SMTP ports (`--network host`, or `--network container:<bridge>` to share Bridge's network). The CLI is in the same image: add `--entrypoint proton-mail-bridge-client` and a command such as `doctor`. If Bridge is reached by a host name (for example `host.docker.internal` or another container), its self-signed certificate fails verification: export it from Bridge and point `PROTONMAIL_TLS_CA_FILE` at it, or list the name in `PROTONMAIL_TLS_INSECURE_HOSTS`. The server has no network transport of its own; reaching it from a remote client needs your own wrapper. The image was checked to build, report its version, run as a non-root user and answer an MCP `initialize`, and (by a tester, against a real Bridge) to pass `doctor`, list folders, sync and exit cleanly, with `--network container:<bridge>` or with Bridge reached by host name using `PROTONMAIL_TLS_CA_FILE` or `PROTONMAIL_TLS_INSECURE_HOSTS`.
|
|
307
308
|
|
|
308
309
|
## Autoresponder (automatic reply per address)
|
|
309
310
|
|
|
@@ -332,6 +333,30 @@ get_autoresponder account=work@example.com # state, counts
|
|
|
332
333
|
|
|
333
334
|
`outgoingNote` is appended, after the signature, to every mail sent from that address while the rule is active (a send with `appendSignature: false` opts out). On the command line: `set-autoresponder`, `autoresponder` and `preview-autoresponder`. The rule, the log and the memory of who was answered live in `autoresponder.json` in the account's data directory; every account (every address Bridge exposes) has its own.
|
|
334
335
|
|
|
336
|
+
## Mailbox rules (suggestions, filters, cleanup, forwarding)
|
|
337
|
+
|
|
338
|
+
Proton's own filters act on **new** mail, the free plan has one custom filter, and auto-delete of Trash and Spam is a paid feature with a fixed 30 days (see Proton's pages on [filters](https://proton.me/support/email-inbox-filters) and [auto-delete](https://proton.me/support/auto-delete-unwanted-messages)). These rules work alongside them: on mail that is already there, with a preview, and with a scan that suggests rules instead of waiting for you to write them. They run on this server, so they only act while it runs.
|
|
339
|
+
|
|
340
|
+
**Scan, then decide.** `suggest_rules` looks through the mail in the local index and proposes, with the evidence for each: newsletters and other automatic mail you never open (archive and mark as read; or move to Trash when old), people whose mail you always file in the same folder, and an old Trash or Spam that was never emptied. Each says how risky it is (`low`: only moves and marks; `recoverable`: moves to Trash; `permanent`: deletes). **Nothing changes** until you accept one with `set_rule proposalId=...`; `delete_rule` on a proposal dismisses it for good.
|
|
341
|
+
|
|
342
|
+
**A rule** is `when` (sender or `*@domain`, words in the subject, folder, `olderThanDays`, `hasAttachment`, `automated`, `unread`) and `actions` (`markRead`, `label`, `archive`, `moveTo`, `trash`, `delete`, `forwardTo`). A rule needs a real condition, so it cannot touch a whole folder.
|
|
343
|
+
|
|
344
|
+
- **By itself, on new mail**, after each background sync: mark read, label, archive, move, forward. Only mail that arrived after the rule was switched on, once per message.
|
|
345
|
+
- **Only when you ask:** a rule that trashes or deletes never runs by itself. `apply_rules` runs the rules on mail already in the index and is a **preview unless `dryRun: false`**; deleting for good also needs `confirmed: true`. Every action goes through the same permissions as the other tools (`PROTONMAIL_MODE`, allowed actions), and a disallowed one is refused before anything is touched.
|
|
346
|
+
- **Forwarding** (`actions.forwardTo`, up to 3 addresses, optional `forwardNote`) sends mail out on its own, so it is held to the rules of a send: sending must be allowed, the recipients must be allowed (not with `PROTONMAIL_RESTRICT_OUTBOUND_TO_SELF`), switching it on needs `confirmed: true` when `PROTONMAIL_CONFIRM_DESTRUCTIVE` is on, and the rule needs a condition on the sender, the subject or an attachment. It forwards mail that arrives after the rule is switched on, once per message, at most 50 a day, with the original attachments, and by default only mail from people (not lists or automatic mail). The copy carries `Auto-Submitted: auto-generated` and `X-Forwarded-By`.
|
|
347
|
+
|
|
348
|
+
```text
|
|
349
|
+
suggest_rules days=90 # proposals, with evidence; nothing is changed
|
|
350
|
+
set_rule proposalId=p-1a2b3c4d5e # accept one
|
|
351
|
+
set_rule name="Clients to Projects" when={"from":["*@client.example"]} actions={"moveTo":"Projects","markRead":false}
|
|
352
|
+
set_rule name="Boss to phone" when={"from":["boss@example.com"]} actions={"forwardTo":["me@elsewhere.example"]} confirmed=true
|
|
353
|
+
apply_rules # preview of what the rules would do to existing mail
|
|
354
|
+
apply_rules dryRun=false limit=100
|
|
355
|
+
get_rules # rules, waiting proposals, what the rules did lately
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
The scan and `apply_rules` work from the local index (by default INBOX and Sent; run `sync_emails` for other folders), so check that it is fresh. Rules, proposals and the log live in `rules.json` in the account's data directory; each account has its own.
|
|
359
|
+
|
|
335
360
|
## Multi-account support (v2.1.0+)
|
|
336
361
|
|
|
337
362
|
Use more than one Proton mailbox from the same server: either several addresses of one account (Bridge's **Split Addresses** feature) or separate Proton accounts signed in to the same Bridge. Each one gets its own isolated service stack, local index, and drafts storage.
|
|
@@ -471,7 +496,7 @@ All commands support `--json` for machine-readable output, and any MCP tool is d
|
|
|
471
496
|
|
|
472
497
|
`<command> --help` prints that command's usage without running it. Flags accept `--flag value` or `--flag=value` (a value starting with `--` needs the `=` form, or must come after a bare `--`); unknown flags are an error. Exit codes: `0` success, `1` failure (including a failed `doctor` or `connection-status` check, or a failed item in a `batch`/`bulk-*` run), `2` usage error.
|
|
473
498
|
|
|
474
|
-
**Full command reference: [docs/cli.md](docs/cli.md)** (a named command for every one of the
|
|
499
|
+
**Full command reference: [docs/cli.md](docs/cli.md)** (a named command for every one of the 108 tools, across read, triage, compose, mailbox actions, folders, drafts, templates, analytics, and diagnostics).
|
|
475
500
|
|
|
476
501
|
---
|
|
477
502
|
|
|
@@ -493,7 +518,7 @@ A mode is a floor: the individual flags below can make things stricter (`PROTONM
|
|
|
493
518
|
All flags work in both the MCP server and CLI:
|
|
494
519
|
|
|
495
520
|
```bash
|
|
496
|
-
PROTONMAIL_TOOL_TIER=core # expose 25 core tools instead of all
|
|
521
|
+
PROTONMAIL_TOOL_TIER=core # expose 25 core tools instead of all 108 — saves context window
|
|
497
522
|
PROTONMAIL_READ_ONLY=true # disable all write operations
|
|
498
523
|
PROTONMAIL_ALLOW_SEND=false # disable SMTP sends only (other writes still work)
|
|
499
524
|
PROTONMAIL_CONFIRM_DESTRUCTIVE=true # require confirmed:true on send, reply, forward, delete
|
|
@@ -716,7 +741,7 @@ Measured in October 2026 (v2.7.0) on a copy of the same ~57,000-message index. "
|
|
|
716
741
|
- Defaults are bounded: `search_emails`/`search_indexed_emails` return 50 (pass `limit` for more), `list_drafts` 20, `list_scheduled_sends` 50 newest first. Each reports `hasMore`; page with `offset`.
|
|
717
742
|
- Draft and queued-message bodies are shortened to a preview in list and update responses (`bodyTruncated`, `bodyLength`); use `get_draft` for one full draft. Attachment content is never inlined in a listing.
|
|
718
743
|
- Large attachments: set `PROTONMAIL_ALLOW_FILE_DOWNLOAD_DIR` and pass `saveTo`, rather than raising `PROTONMAIL_MAX_INLINE_KB`.
|
|
719
|
-
- **`PROTONMAIL_TOOL_TIER=core`** exposes 25 tools instead of
|
|
744
|
+
- **`PROTONMAIL_TOOL_TIER=core`** exposes 25 tools instead of 108: about 7k tokens of tool definitions instead of about 21k (roughly 67% less; the earlier measurement with a reference tokenizer, 7k against 20k for 96 tools, scaled by the 3.7% the four newest tool definitions add), paid on every conversation that loads the server.
|
|
720
745
|
- Repeating an `update_draft` that changes nothing on a draft whose remote copy is already in sync does no store write and no IMAP upload. (A draft whose last sync failed, or that was edited with `syncToRemote:false`, still syncs.)
|
|
721
746
|
|
|
722
747
|
**Working with drafts**
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAaA,OAAO,KAAK,EAAgB,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AAqB1F,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;CACjB;AAiBD,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAM3C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAuD1D;AA0ID,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAOD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAqErD,CAAC;AAoBF,eAAO,MAAM,iBAAiB,YAAI,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGlE,wBAAgB,kBAAkB,IAAI,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CA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,MAAM,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,EA2E/C,CAAC;AA2EF,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAoP1C;AA4ED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGzD"}
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
9
9
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
10
10
|
import { buildConfigFromEnv, createServer, withAudit } from "./index.js";
|
|
11
11
|
import { isMainModule } from "./is-main.js";
|
|
12
|
-
import { isLikelyAuthenticationError, isLikelyConnectionError, isLikelyTlsMismatchError, SimpleIMAPService } from "./services/simple-imap-service.js";
|
|
12
|
+
import { isLikelyAuthenticationError, isLikelyCertificateError, isLikelyConnectionError, isLikelyTlsMismatchError, SimpleIMAPService } from "./services/simple-imap-service.js";
|
|
13
13
|
import { ensureDestructiveConfirmed, ensureEmailActionAllowed, ensureMailboxWriteAllowed, sanitizeRuntimeConfig } from "./utils/runtime-policy.js";
|
|
14
14
|
import { isValidEmail, parseEmails } from "./utils/helpers.js";
|
|
15
15
|
import { checkForUpdate } from "./utils/update-check.js";
|
|
@@ -163,7 +163,7 @@ function printHelp() {
|
|
|
163
163
|
" watch Wait for mailbox changes via IMAP IDLE (--timeout)",
|
|
164
164
|
" clear-cache Clear in-memory MCP server caches",
|
|
165
165
|
" get-logs Return recent in-memory MCP server logs",
|
|
166
|
-
" notify Daemon: watch INBOX and send a system notification on new mail (--folder --timeout)",
|
|
166
|
+
" notify Daemon: watch INBOX and send a system notification on new mail and when the connection to Bridge breaks or comes back (--folder --timeout)",
|
|
167
167
|
" drafts List local drafts",
|
|
168
168
|
" remote-drafts List drafts in the Proton Drafts mailbox",
|
|
169
169
|
" draft-create Create a draft (--to --subject --body or stdin)",
|
|
@@ -766,6 +766,9 @@ export function diagnoseConnectionFailure(reason) {
|
|
|
766
766
|
suggestion: "PROTONMAIL_PASSWORD must be the Bridge password (Bridge app -> account -> Mailbox details), not your Proton account password.",
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
+
if (isLikelyCertificateError(reason)) {
|
|
770
|
+
return { cause: "certificate_untrusted", suggestion: "Bridge's certificate is not trusted. Bridge presents a self-signed certificate made for localhost, which is accepted for 127.0.0.1, localhost and ::1. For another host name (another container, another machine) set PROTONMAIL_TLS_CA_FILE to Bridge's exported certificate, or list the host in PROTONMAIL_TLS_INSECURE_HOSTS." };
|
|
771
|
+
}
|
|
769
772
|
if (isLikelyTlsMismatchError(reason)) {
|
|
770
773
|
return {
|
|
771
774
|
cause: "tls_mismatch",
|
|
@@ -1746,7 +1749,9 @@ async function runNotify(parsed) {
|
|
|
1746
1749
|
process.stdout.write(JSON.stringify({ event: "problem", cause: health.cause, message: health.notice.body }) + "\n");
|
|
1747
1750
|
}
|
|
1748
1751
|
// Simple backoff before retrying; a rejected login will not fix itself in seconds.
|
|
1749
|
-
|
|
1752
|
+
// Not unref'd: this wait is what keeps the daemon alive between attempts, and the notice that the connection works
|
|
1753
|
+
// again can only come from a process that is still running.
|
|
1754
|
+
await new Promise((resolve) => { setTimeout(resolve, health.cause === "authentication_failed" ? 120_000 : 15_000); });
|
|
1750
1755
|
}
|
|
1751
1756
|
}
|
|
1752
1757
|
try {
|
|
@@ -1995,6 +2000,11 @@ export const TOOL_ONLY_COMMANDS = [
|
|
|
1995
2000
|
{ command: "list-snoozed", tool: "list_snoozed", positionals: [], help: "List snoozed emails (rediscover an id for cancel-snooze)" },
|
|
1996
2001
|
{ command: "create-template", tool: "create_template", positionals: ["name", "subject", "body"], help: "Save a reusable email template" },
|
|
1997
2002
|
{ command: "preview-autoresponder", tool: "preview_autoresponder", positionals: [], help: "Show what the automatic reply would do with recent mail, without doing it (--account, --days)" },
|
|
2003
|
+
{ command: "suggest-rules", tool: "suggest_rules", positionals: [], help: "Scan the mail in the index and propose rules (--account, --days, --minMessages); changes nothing" },
|
|
2004
|
+
{ command: "rules", tool: "get_rules", positionals: [], help: "Show the mailbox rules, the proposals waiting and what the rules did (--account)" },
|
|
2005
|
+
{ command: "set-rule", tool: "set_rule", positionals: [], help: "Create, change or accept a proposal as a rule (--proposalId, --id, --name, --enabled, --when, --actions, --confirmed)" },
|
|
2006
|
+
{ command: "delete-rule", tool: "delete_rule", positionals: ["id"], help: "Delete a rule, or dismiss a proposal" },
|
|
2007
|
+
{ command: "apply-rules", tool: "apply_rules", positionals: [], help: "Run the rules on mail already in the index; a preview unless --dryRun false (--ruleId, --limit, --confirmed)" },
|
|
1998
2008
|
{ command: "autoresponder", tool: "get_autoresponder", positionals: [], help: "Show the automatic reply of an address (--account)" },
|
|
1999
2009
|
{ command: "set-autoresponder", tool: "set_autoresponder", positionals: [], help: "Set up or switch off the automatic reply of an address (--enabled, --body, --subject, --startsAt, --endsAt, --outgoingNote, --mode, --timezone, --rules, --confirmed)" },
|
|
2000
2010
|
{ command: "list-templates", tool: "list_templates", positionals: [], help: "List saved email templates" },
|