proton-mail-bridge-client 2.0.7 → 2.0.9
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/services/draft-store-service.d.ts +2 -0
- package/dist/services/draft-store-service.d.ts.map +1 -1
- package/dist/services/draft-store-service.js +2 -0
- package/dist/services/draft-store-service.js.map +1 -1
- package/dist/services/local-index-service.d.ts.map +1 -1
- package/dist/services/local-index-service.js +13 -4
- package/dist/services/local-index-service.js.map +1 -1
- 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 +33 -1
- package/dist/services/simple-imap-service.js.map +1 -1
- package/dist/services/smtp-service.d.ts.map +1 -1
- package/dist/services/smtp-service.js +7 -2
- package/dist/services/smtp-service.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
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,CAA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: "Optional display name for the From header (e.g. 'Alice'). Does not change the sending address." },
|
|
62
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
62
63
|
sanitizeHtml: { type: "boolean", description: "Strip scripts, event handlers, and remote image beacons from HTML before delivery. Defaults to true when body is HTML.", default: true },
|
|
63
64
|
replyTo: { type: "string", description: "Optional reply-to email address." },
|
|
64
65
|
requestReadReceipt: { type: "boolean", description: "Request a read receipt (MDN) via a Disposition-Notification-To header. Most mail clients ask the recipient before honoring it — this is a request, not a guarantee.", default: false },
|
|
@@ -162,6 +163,7 @@ const TOOLS = [
|
|
|
162
163
|
cc: { type: "string", description: "Additional CC recipients, comma-separated." },
|
|
163
164
|
bcc: { type: "string", description: "Additional BCC recipients, comma-separated." },
|
|
164
165
|
fromName: { type: "string", description: "Optional display name for the From header." },
|
|
166
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
165
167
|
sanitizeHtml: { type: "boolean", description: "Strip scripts and remote image beacons from HTML before delivery. Defaults to true.", default: true },
|
|
166
168
|
attachments: {
|
|
167
169
|
type: "array",
|
|
@@ -200,6 +202,7 @@ const TOOLS = [
|
|
|
200
202
|
cc: { type: "string", description: "Additional CC recipients, comma-separated." },
|
|
201
203
|
bcc: { type: "string", description: "Additional BCC recipients, comma-separated." },
|
|
202
204
|
fromName: { type: "string", description: "Optional display name for the From header." },
|
|
205
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
203
206
|
sanitizeHtml: { type: "boolean", description: "Strip scripts and remote image beacons from HTML before delivery. Defaults to true.", default: true },
|
|
204
207
|
attachments: {
|
|
205
208
|
type: "array",
|
|
@@ -239,6 +242,7 @@ const TOOLS = [
|
|
|
239
242
|
cc: { type: "string", description: "CC recipients, comma-separated." },
|
|
240
243
|
bcc: { type: "string", description: "BCC recipients, comma-separated." },
|
|
241
244
|
fromName: { type: "string", description: "Optional display name for the From header." },
|
|
245
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
242
246
|
sanitizeHtml: { type: "boolean", description: "Strip scripts and remote image beacons from HTML before delivery. Defaults to true.", default: true },
|
|
243
247
|
attachments: {
|
|
244
248
|
type: "array",
|
|
@@ -279,6 +283,7 @@ const TOOLS = [
|
|
|
279
283
|
isHtml: { type: "boolean", description: "Whether the body should be HTML.", default: false },
|
|
280
284
|
priority: { type: "string", enum: ["high", "normal", "low"] },
|
|
281
285
|
replyTo: { type: "string", description: "Optional reply-to email address." },
|
|
286
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default when the draft is sent (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
282
287
|
notes: { type: "string", description: "Optional local note for the draft." },
|
|
283
288
|
syncToRemote: {
|
|
284
289
|
type: "boolean",
|
|
@@ -432,6 +437,7 @@ const TOOLS = [
|
|
|
432
437
|
isHtml: { type: "boolean", description: "Whether the body should be HTML." },
|
|
433
438
|
priority: { type: "string", enum: ["high", "normal", "low"] },
|
|
434
439
|
replyTo: { type: "string", description: "Optional reply-to email address." },
|
|
440
|
+
from: { type: "string", description: "Send as this address instead of the Bridge login's default when the draft is sent (e.g. an alias or additional address on the same Proton account). Proton accepts any address verified on the account; an address not on the account is rejected by Proton at send time." },
|
|
435
441
|
notes: { type: "string", description: "Optional local note for the draft." },
|
|
436
442
|
syncToRemote: {
|
|
437
443
|
type: "boolean",
|
|
@@ -3006,6 +3012,7 @@ export function createServer(config, options = {}) {
|
|
|
3006
3012
|
const priority = optionalString(args, "priority");
|
|
3007
3013
|
const replyTo = optionalString(args, "replyTo");
|
|
3008
3014
|
const fromName = optionalString(args, "fromName");
|
|
3015
|
+
const from = optionalString(args, "from");
|
|
3009
3016
|
const sanitizeHtml = normalizeBoolean(args.sanitizeHtml, true);
|
|
3010
3017
|
const attachments = optionalAttachmentList(args.attachments);
|
|
3011
3018
|
ensureValidEmails(to, "to");
|
|
@@ -3014,6 +3021,9 @@ export function createServer(config, options = {}) {
|
|
|
3014
3021
|
if (replyTo && !isValidEmail(replyTo)) {
|
|
3015
3022
|
throw new McpError(ErrorCode.InvalidParams, "replyTo must be a valid email address.");
|
|
3016
3023
|
}
|
|
3024
|
+
if (from && !isValidEmail(from)) {
|
|
3025
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3026
|
+
}
|
|
3017
3027
|
// dryRun: preview without sending
|
|
3018
3028
|
const dryRunSend = normalizeBoolean(args.dryRun, false);
|
|
3019
3029
|
// RESTRICT_OUTBOUND_TO_SELF check
|
|
@@ -3037,6 +3047,7 @@ export function createServer(config, options = {}) {
|
|
|
3037
3047
|
isHtml,
|
|
3038
3048
|
htmlBody,
|
|
3039
3049
|
fromName,
|
|
3050
|
+
from,
|
|
3040
3051
|
sanitizeHtml,
|
|
3041
3052
|
priority: priority === "high" || priority === "low" || priority === "normal"
|
|
3042
3053
|
? priority
|
|
@@ -3164,6 +3175,10 @@ export function createServer(config, options = {}) {
|
|
|
3164
3175
|
const htmlBody = markdownBodyReply ? renderMarkdown(markdownBodyReply).html : undefined;
|
|
3165
3176
|
const replyAll = normalizeBoolean(args.replyAll, false);
|
|
3166
3177
|
const fromNameReply = optionalString(args, "fromName");
|
|
3178
|
+
const fromReply = optionalString(args, "from");
|
|
3179
|
+
if (fromReply && !isValidEmail(fromReply)) {
|
|
3180
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3181
|
+
}
|
|
3167
3182
|
const sanitizeHtmlReply = normalizeBoolean(args.sanitizeHtml, true);
|
|
3168
3183
|
const attachments = optionalAttachmentList(args.attachments);
|
|
3169
3184
|
const extraCc = parseEmails(optionalString(args, "cc"));
|
|
@@ -3203,6 +3218,7 @@ export function createServer(config, options = {}) {
|
|
|
3203
3218
|
isHtml,
|
|
3204
3219
|
htmlBody: signedReply.htmlBody,
|
|
3205
3220
|
fromName: fromNameReply,
|
|
3221
|
+
from: fromReply,
|
|
3206
3222
|
sanitizeHtml: sanitizeHtmlReply,
|
|
3207
3223
|
inReplyTo: detail.messageId,
|
|
3208
3224
|
references: detail.messageId ? [detail.messageId] : undefined,
|
|
@@ -3240,6 +3256,10 @@ export function createServer(config, options = {}) {
|
|
|
3240
3256
|
const isHtmlRa = markdownBodyRa ? false : normalizeBoolean(args.isHtml, false);
|
|
3241
3257
|
const htmlBodyRa = markdownBodyRa ? renderMarkdown(markdownBodyRa).html : undefined;
|
|
3242
3258
|
const fromNameRa = optionalString(args, "fromName");
|
|
3259
|
+
const fromRa = optionalString(args, "from");
|
|
3260
|
+
if (fromRa && !isValidEmail(fromRa)) {
|
|
3261
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3262
|
+
}
|
|
3243
3263
|
const sanitizeHtmlRa = normalizeBoolean(args.sanitizeHtml, true);
|
|
3244
3264
|
const attachmentsRa = optionalAttachmentList(args.attachments);
|
|
3245
3265
|
const extraCcRa = parseEmails(optionalString(args, "cc"));
|
|
@@ -3279,6 +3299,7 @@ export function createServer(config, options = {}) {
|
|
|
3279
3299
|
isHtml: isHtmlRa,
|
|
3280
3300
|
htmlBody: signedReplyRa.htmlBody,
|
|
3281
3301
|
fromName: fromNameRa,
|
|
3302
|
+
from: fromRa,
|
|
3282
3303
|
sanitizeHtml: sanitizeHtmlRa,
|
|
3283
3304
|
inReplyTo: detailRa.messageId,
|
|
3284
3305
|
references: detailRa.messageId ? [detailRa.messageId] : undefined,
|
|
@@ -3319,6 +3340,10 @@ export function createServer(config, options = {}) {
|
|
|
3319
3340
|
const isHtml = markdownBodyFwd ? false : normalizeBoolean(args.isHtml, false);
|
|
3320
3341
|
const htmlBody = markdownBodyFwd ? renderMarkdown(markdownBodyFwd).html : undefined;
|
|
3321
3342
|
const fromNameFwd = optionalString(args, "fromName");
|
|
3343
|
+
const fromFwd = optionalString(args, "from");
|
|
3344
|
+
if (fromFwd && !isValidEmail(fromFwd)) {
|
|
3345
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3346
|
+
}
|
|
3322
3347
|
const sanitizeHtmlFwd = normalizeBoolean(args.sanitizeHtml, true);
|
|
3323
3348
|
// args.attachments are new attachments the caller wants to add to the
|
|
3324
3349
|
// forward — they are NOT the original message's attachments. Despite
|
|
@@ -3377,6 +3402,7 @@ export function createServer(config, options = {}) {
|
|
|
3377
3402
|
isHtml,
|
|
3378
3403
|
htmlBody: signedFwd.htmlBody,
|
|
3379
3404
|
fromName: fromNameFwd,
|
|
3405
|
+
from: fromFwd,
|
|
3380
3406
|
sanitizeHtml: sanitizeHtmlFwd,
|
|
3381
3407
|
attachments: fwdAttachments,
|
|
3382
3408
|
// Already applied above, before quote-wrapping.
|
|
@@ -3410,6 +3436,7 @@ export function createServer(config, options = {}) {
|
|
|
3410
3436
|
const subject = requireString(args, "subject");
|
|
3411
3437
|
const body = requireString(args, "body");
|
|
3412
3438
|
const replyTo = optionalString(args, "replyTo");
|
|
3439
|
+
const from = optionalString(args, "from");
|
|
3413
3440
|
const attachments = optionalAttachmentList(args.attachments);
|
|
3414
3441
|
const priority = optionalString(args, "priority");
|
|
3415
3442
|
ensureValidEmails(to, "to");
|
|
@@ -3418,6 +3445,9 @@ export function createServer(config, options = {}) {
|
|
|
3418
3445
|
if (replyTo && !isValidEmail(replyTo)) {
|
|
3419
3446
|
throw new McpError(ErrorCode.InvalidParams, "replyTo must be a valid email address.");
|
|
3420
3447
|
}
|
|
3448
|
+
if (from && !isValidEmail(from)) {
|
|
3449
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3450
|
+
}
|
|
3421
3451
|
const result = await withAudit(auditService, name, args, async () => {
|
|
3422
3452
|
const draft = await draftStore.createDraft({
|
|
3423
3453
|
mode: "compose",
|
|
@@ -3431,6 +3461,7 @@ export function createServer(config, options = {}) {
|
|
|
3431
3461
|
? priority
|
|
3432
3462
|
: undefined,
|
|
3433
3463
|
replyTo,
|
|
3464
|
+
from,
|
|
3434
3465
|
notes: optionalString(args, "notes"),
|
|
3435
3466
|
attachments,
|
|
3436
3467
|
});
|
|
@@ -3618,6 +3649,7 @@ export function createServer(config, options = {}) {
|
|
|
3618
3649
|
const cc = args.cc === undefined ? undefined : parseEmails(optionalString(args, "cc"));
|
|
3619
3650
|
const bcc = args.bcc === undefined ? undefined : parseEmails(optionalString(args, "bcc"));
|
|
3620
3651
|
const replyTo = optionalString(args, "replyTo");
|
|
3652
|
+
const from = optionalString(args, "from");
|
|
3621
3653
|
const priority = optionalString(args, "priority");
|
|
3622
3654
|
const attachments = args.attachments === undefined ? undefined : optionalAttachmentList(args.attachments);
|
|
3623
3655
|
if (to) {
|
|
@@ -3632,6 +3664,9 @@ export function createServer(config, options = {}) {
|
|
|
3632
3664
|
if (replyTo && !isValidEmail(replyTo)) {
|
|
3633
3665
|
throw new McpError(ErrorCode.InvalidParams, "replyTo must be a valid email address.");
|
|
3634
3666
|
}
|
|
3667
|
+
if (from && !isValidEmail(from)) {
|
|
3668
|
+
throw new McpError(ErrorCode.InvalidParams, "from must be a valid email address.");
|
|
3669
|
+
}
|
|
3635
3670
|
const result = await withAudit(auditService, name, args, async () => {
|
|
3636
3671
|
const draft = await draftStore.updateDraft(draftId, {
|
|
3637
3672
|
to,
|
|
@@ -3644,6 +3679,7 @@ export function createServer(config, options = {}) {
|
|
|
3644
3679
|
? priority
|
|
3645
3680
|
: undefined,
|
|
3646
3681
|
replyTo,
|
|
3682
|
+
from,
|
|
3647
3683
|
attachments,
|
|
3648
3684
|
notes: optionalString(args, "notes"),
|
|
3649
3685
|
});
|
|
@@ -3771,6 +3807,7 @@ export function createServer(config, options = {}) {
|
|
|
3771
3807
|
isHtml: draft.isHtml,
|
|
3772
3808
|
priority: draft.priority,
|
|
3773
3809
|
replyTo: draft.replyTo,
|
|
3810
|
+
from: draft.from,
|
|
3774
3811
|
inReplyTo: draft.inReplyTo,
|
|
3775
3812
|
references: draft.references,
|
|
3776
3813
|
attachments: draft.attachments,
|
|
@@ -3921,6 +3958,7 @@ export function createServer(config, options = {}) {
|
|
|
3921
3958
|
isHtml: draft.isHtml,
|
|
3922
3959
|
priority: draft.priority,
|
|
3923
3960
|
replyTo: draft.replyTo,
|
|
3961
|
+
from: draft.from,
|
|
3924
3962
|
inReplyTo: draft.inReplyTo,
|
|
3925
3963
|
references: draft.references,
|
|
3926
3964
|
attachments: draft.attachments,
|