proton-mail-bridge-client 2.0.9 → 2.1.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 +83 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1548 -416
- package/dist/index.js.map +1 -1
- package/dist/services/account-manager.d.ts +37 -0
- package/dist/services/account-manager.d.ts.map +1 -0
- package/dist/services/account-manager.js +98 -0
- package/dist/services/account-manager.js.map +1 -0
- package/dist/services/background-sync-service.d.ts.map +1 -1
- package/dist/services/background-sync-service.js +8 -0
- package/dist/services/background-sync-service.js.map +1 -1
- package/dist/services/smtp-service.d.ts +1 -1
- package/dist/services/smtp-service.d.ts.map +1 -1
- package/dist/services/smtp-service.js +18 -2
- package/dist/services/smtp-service.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +6 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +33 -0
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -264,6 +264,82 @@ Reload the Cline extension after saving. Proton Mail tools will appear in Cline'
|
|
|
264
264
|
|
|
265
265
|
---
|
|
266
266
|
|
|
267
|
+
## Multi-account support (v2.1.0+)
|
|
268
|
+
|
|
269
|
+
Support multiple Proton Mail addresses configured in Bridge (using Bridge's **Split Addresses** feature). Each address gets its own isolated service stack, local index, and drafts storage.
|
|
270
|
+
|
|
271
|
+
### Setup
|
|
272
|
+
|
|
273
|
+
First, enable **Split Addresses** in Proton Bridge and configure each address as a separate account. Bridge will generate a separate password for each address. Then set `PROTONMAIL_ACCOUNTS_JSON`:
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"mcpServers": {
|
|
278
|
+
"proton-mail-bridge": {
|
|
279
|
+
"command": "proton-mail-bridge-mcp",
|
|
280
|
+
"env": {
|
|
281
|
+
"PROTONMAIL_USERNAME": "primary@proton.me",
|
|
282
|
+
"PROTONMAIL_PASSWORD": "primary-bridge-password",
|
|
283
|
+
"PROTONMAIL_IMAP_HOST": "127.0.0.1",
|
|
284
|
+
"PROTONMAIL_IMAP_PORT": "1143",
|
|
285
|
+
"PROTONMAIL_IMAP_SECURE": "false",
|
|
286
|
+
"PROTONMAIL_SMTP_HOST": "127.0.0.1",
|
|
287
|
+
"PROTONMAIL_SMTP_PORT": "1025",
|
|
288
|
+
"PROTONMAIL_ACCOUNTS_JSON": "[
|
|
289
|
+
{ \"address\": \"primary@proton.me\", \"password\": \"primary-bridge-password\" },
|
|
290
|
+
{ \"address\": \"alias@proton.me\", \"password\": \"alias-bridge-password\" },
|
|
291
|
+
{ \"address\": \"business@custom.com\", \"password\": \"business-bridge-password\" }
|
|
292
|
+
]"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Note:** The password is the **Bridge password for each address**, not your Proton account password. Bridge generates a unique password for each Split Address.
|
|
300
|
+
|
|
301
|
+
### How it works
|
|
302
|
+
|
|
303
|
+
- **Primary account:** the first entry in `PROTONMAIL_ACCOUNTS_JSON` (or the main `PROTONMAIL_USERNAME`/`PROTONMAIL_PASSWORD` pair if not set). Email IDs from the primary account have no prefix.
|
|
304
|
+
- **Additional accounts:** each has an auto-generated slug (e.g., `alias`, `business`). Email IDs carry an account prefix: `alias::message-id`, `business::message-id`.
|
|
305
|
+
- **Sending:** `send_email`, `reply_to_email`, etc. route through the account matching the `from` address. If no account matches, the primary connection is used with a header override (for non-configured aliases).
|
|
306
|
+
- **Search and read:** all read tools (search, threads, analytics, digest) automatically fan out across all configured accounts and merge results, preserving the account prefix in returned IDs.
|
|
307
|
+
|
|
308
|
+
### Tools across accounts
|
|
309
|
+
|
|
310
|
+
**Fan out across all accounts:**
|
|
311
|
+
- Search & read: `search_indexed_emails`, `get_emails`, `get_threads`, `get_thread_by_id`, `count_messages`, `get_labels`, `folder_stats`, `top_senders`, `get_contacts`, `get_volume_trends`, `get_email_analytics`, `get_email_stats`, `get_folders`
|
|
312
|
+
- Triage: `get_inbox_digest`, `get_follow_up_candidates`, `get_actionable_threads`, `find_document_threads`, `prepare_meeting_context`
|
|
313
|
+
- Diagnostics: `get_connection_status`, `get_runtime_status`, `run_doctor` (include an `accounts` array showing per-account status)
|
|
314
|
+
|
|
315
|
+
**Account-specific (prefix to target):**
|
|
316
|
+
- Actions: `mark_email_read`, `star_email`, `move_email`, `delete_email`, etc. — prefix the `emailId` with account slug if targeting a non-primary account
|
|
317
|
+
- Drafts: `create_draft`, `get_draft`, `send_draft`, etc. — drafts live per account; prefix `draftId` to access non-primary drafts
|
|
318
|
+
- Send: `send_email`, `reply_to_email`, `forward_email` — match the `from` address to route through the correct account's SMTP
|
|
319
|
+
|
|
320
|
+
**Primary-only (for now):**
|
|
321
|
+
- `list_drafts`, `list_remote_drafts` — show primary account drafts only
|
|
322
|
+
- Thread actions (`move_thread`, `delete_thread`, `flag_thread`) — operate on the account the thread ID's prefix names
|
|
323
|
+
|
|
324
|
+
### Verify setup
|
|
325
|
+
|
|
326
|
+
Use `list_accounts` to check configured accounts and verify connection status:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
proton-mail-bridge-client list_accounts --json
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Output:
|
|
333
|
+
```json
|
|
334
|
+
[
|
|
335
|
+
{ "slug": "primary", "address": "primary@proton.me", "isPrimary": true, "index": "fresh", "imap": "ok", "smtp": "ok" },
|
|
336
|
+
{ "slug": "alias", "address": "alias@proton.me", "isPrimary": false, "index": "fresh", "imap": "ok", "smtp": "ok" },
|
|
337
|
+
{ "slug": "business", "address": "business@custom.com", "isPrimary": false, "index": "stale", "imap": "timeout", "smtp": "ok" }
|
|
338
|
+
]
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
267
343
|
## Try it: example Claude prompts
|
|
268
344
|
|
|
269
345
|
**Morning triage**
|
|
@@ -370,7 +446,13 @@ PROTONMAIL_ALLOW_REMOTE_DRAFT_SYNC='true'
|
|
|
370
446
|
PROTONMAIL_ALLOWED_ACTIONS='mark_read,mark_unread,star,unstar,archive,trash,restore,move,delete'
|
|
371
447
|
PROTONMAIL_CONFIRM_DESTRUCTIVE='false'
|
|
372
448
|
PROTONMAIL_SEND_DELAY_SECONDS='0' # >0: send_email queues instead of sending immediately, cancelable via cancel_send. Only fires while this server stays running.
|
|
373
|
-
PROTONMAIL_SIGNATURE='' # Plain text, appended to send_email/reply_to_email/reply_all_email/forward_email bodies (text + HTML), after your own text and before any quoted/forwarded content. Opt out per-message with appendSignature: false. Never applied to send_draft/schedule_draft — draft content is already finalized.
|
|
449
|
+
PROTONMAIL_SIGNATURE='' # Plain text, appended to send_email/reply_to_email/reply_all_email/forward_email bodies (text + HTML), after your own text and before any quoted/forwarded content. Every send now goes out multipart (a plain-text send auto-gets an html alternative too), so the signature always gets its HTML treatment, not just the text/plain part. Opt out per-message with appendSignature: false. Never applied to send_draft/schedule_draft — draft content is already finalized.
|
|
450
|
+
#
|
|
451
|
+
# Note: a signature configured inside Proton Mail itself (Settings → Identity and addressing)
|
|
452
|
+
# is only inserted by Proton's own web/app compose UI — it is NEVER applied to mail submitted
|
|
453
|
+
# over SMTP by an external client, including this one. There is no way to make Bridge apply it
|
|
454
|
+
# for you. Set PROTONMAIL_SIGNATURE above instead if you want a signature on messages this
|
|
455
|
+
# server sends.
|
|
374
456
|
|
|
375
457
|
# Sync
|
|
376
458
|
PROTONMAIL_AUTO_SYNC='true'
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { LocalIndexService } from "./services/local-index-service.js";
|
|
|
8
8
|
import { SimpleIMAPService } from "./services/simple-imap-service.js";
|
|
9
9
|
import { SMTPService } from "./services/smtp-service.js";
|
|
10
10
|
import { SnoozeService } from "./services/snooze-service.js";
|
|
11
|
-
import type { DraftRecord, EmailDetail, ProtonMailConfig } from "./types/index.js";
|
|
11
|
+
import type { BulkOperationResult, DraftRecord, EmailDetail, ProtonMailConfig } from "./types/index.js";
|
|
12
|
+
import { AccountManager, type AccountBundle } from "./services/account-manager.js";
|
|
12
13
|
export declare const CORE_TOOL_NAMES: Set<string>;
|
|
13
14
|
export declare function withAudit<T>(auditService: AuditService, tool: string, input: Record<string, unknown>, operation: () => Promise<T>): Promise<T>;
|
|
14
15
|
export declare function headerString(headers: Record<string, unknown> | undefined, name: string): string | undefined;
|
|
@@ -26,6 +27,7 @@ export declare function getReplyRecipients(detail: EmailDetail, ownerEmail: stri
|
|
|
26
27
|
to: string[];
|
|
27
28
|
cc: string[];
|
|
28
29
|
};
|
|
30
|
+
export declare function tagAccountIds<T>(slug: string | undefined, value: T): T;
|
|
29
31
|
export declare function redactDraftAttachmentsForListing(draft: DraftRecord): {
|
|
30
32
|
attachments: {
|
|
31
33
|
filename: string;
|
|
@@ -63,6 +65,19 @@ export declare function redactDraftAttachmentsForListing(draft: DraftRecord): {
|
|
|
63
65
|
};
|
|
64
66
|
export declare function getBulkMaxBatchSize(args: Record<string, unknown>): number;
|
|
65
67
|
export declare function ensureBulkBatchSize(uidsLength: number, max: number): void;
|
|
68
|
+
interface BulkExcludedEmailId {
|
|
69
|
+
emailId: string;
|
|
70
|
+
error: string;
|
|
71
|
+
}
|
|
72
|
+
export declare function getBulkNotFoundEmailIds(emailIds: string[] | undefined, folder: string, currentUidValidity?: string): BulkExcludedEmailId[];
|
|
73
|
+
export declare function withBulkNotFound(result: BulkOperationResult, excludedEmailIds: BulkExcludedEmailId[]): BulkOperationResult;
|
|
74
|
+
export declare function groupEmailIdsByAccount(accountManager: AccountManager, emailIds: string[]): Map<string | undefined, {
|
|
75
|
+
bundle: AccountBundle;
|
|
76
|
+
restIds: string[];
|
|
77
|
+
}>;
|
|
78
|
+
export declare function prefixBulkResult(result: BulkOperationResult, slug: string | undefined): BulkOperationResult;
|
|
79
|
+
export declare function prefixNotFound(excluded: BulkExcludedEmailId[], slug: string | undefined): BulkExcludedEmailId[];
|
|
80
|
+
export declare function mergeBulkResults(results: BulkOperationResult[]): BulkOperationResult;
|
|
66
81
|
export declare function buildConfigFromEnv(): ProtonMailConfig;
|
|
67
82
|
export declare function createServer(config: ProtonMailConfig, options?: {
|
|
68
83
|
startBackgroundSync?: boolean;
|
|
@@ -111,4 +126,5 @@ export declare function createServer(config: ProtonMailConfig, options?: {
|
|
|
111
126
|
auditService: AuditService;
|
|
112
127
|
};
|
|
113
128
|
export declare function main(): Promise<void>;
|
|
129
|
+
export {};
|
|
114
130
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAA2H,iBAAiB,EAA+B,MAAM,mCAAmC,CAAC;AAC5N,OAAO,EAAkB,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAMV,WAAW,EAIX,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,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