@rndmjoker/proton-mcp 0.4.4
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/LICENSE +20 -0
- package/README.md +405 -0
- package/dist/activity.d.ts +49 -0
- package/dist/activity.js +72 -0
- package/dist/activity.js.map +1 -0
- package/dist/bridge/certificate.d.ts +75 -0
- package/dist/bridge/certificate.js +176 -0
- package/dist/bridge/certificate.js.map +1 -0
- package/dist/bridge/connection.d.ts +99 -0
- package/dist/bridge/connection.js +244 -0
- package/dist/bridge/connection.js.map +1 -0
- package/dist/bridge/errors.d.ts +35 -0
- package/dist/bridge/errors.js +56 -0
- package/dist/bridge/errors.js.map +1 -0
- package/dist/config.d.ts +92 -0
- package/dist/config.js +142 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials/availability.d.ts +62 -0
- package/dist/credentials/availability.js +107 -0
- package/dist/credentials/availability.js.map +1 -0
- package/dist/credentials/encrypted-file.d.ts +50 -0
- package/dist/credentials/encrypted-file.js +156 -0
- package/dist/credentials/encrypted-file.js.map +1 -0
- package/dist/credentials/keyring.d.ts +48 -0
- package/dist/credentials/keyring.js +97 -0
- package/dist/credentials/keyring.js.map +1 -0
- package/dist/credentials/plain-file.d.ts +24 -0
- package/dist/credentials/plain-file.js +78 -0
- package/dist/credentials/plain-file.js.map +1 -0
- package/dist/credentials/probe-keyring.d.ts +11 -0
- package/dist/credentials/probe-keyring.js +57 -0
- package/dist/credentials/probe-keyring.js.map +1 -0
- package/dist/credentials/session.d.ts +15 -0
- package/dist/credentials/session.js +21 -0
- package/dist/credentials/session.js.map +1 -0
- package/dist/credentials/store.d.ts +80 -0
- package/dist/credentials/store.js +94 -0
- package/dist/credentials/store.js.map +1 -0
- package/dist/in-flight.d.ts +33 -0
- package/dist/in-flight.js +78 -0
- package/dist/in-flight.js.map +1 -0
- package/dist/mail/actions.d.ts +116 -0
- package/dist/mail/actions.js +265 -0
- package/dist/mail/actions.js.map +1 -0
- package/dist/mail/attachments.d.ts +39 -0
- package/dist/mail/attachments.js +86 -0
- package/dist/mail/attachments.js.map +1 -0
- package/dist/mail/compose.d.ts +264 -0
- package/dist/mail/compose.js +395 -0
- package/dist/mail/compose.js.map +1 -0
- package/dist/mail/drafts.d.ts +138 -0
- package/dist/mail/drafts.js +449 -0
- package/dist/mail/drafts.js.map +1 -0
- package/dist/mail/ids.d.ts +78 -0
- package/dist/mail/ids.js +135 -0
- package/dist/mail/ids.js.map +1 -0
- package/dist/mail/labels.d.ts +61 -0
- package/dist/mail/labels.js +139 -0
- package/dist/mail/labels.js.map +1 -0
- package/dist/mail/markup.d.ts +91 -0
- package/dist/mail/markup.js +265 -0
- package/dist/mail/markup.js.map +1 -0
- package/dist/mail/messages.d.ts +147 -0
- package/dist/mail/messages.js +219 -0
- package/dist/mail/messages.js.map +1 -0
- package/dist/mail/quote.d.ts +65 -0
- package/dist/mail/quote.js +157 -0
- package/dist/mail/quote.js.map +1 -0
- package/dist/mail/search.d.ts +66 -0
- package/dist/mail/search.js +107 -0
- package/dist/mail/search.js.map +1 -0
- package/dist/mail/send.d.ts +61 -0
- package/dist/mail/send.js +132 -0
- package/dist/mail/send.js.map +1 -0
- package/dist/mime/parse.d.ts +110 -0
- package/dist/mime/parse.js +194 -0
- package/dist/mime/parse.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +387 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +86 -0
- package/dist/session.js +220 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +52 -0
- package/dist/settings.js +80 -0
- package/dist/settings.js.map +1 -0
- package/dist/tools/actions.d.ts +21 -0
- package/dist/tools/actions.js +133 -0
- package/dist/tools/actions.js.map +1 -0
- package/dist/tools/capabilities.d.ts +52 -0
- package/dist/tools/capabilities.js +96 -0
- package/dist/tools/capabilities.js.map +1 -0
- package/dist/tools/confirm.d.ts +84 -0
- package/dist/tools/confirm.js +212 -0
- package/dist/tools/confirm.js.map +1 -0
- package/dist/tools/drafts.d.ts +21 -0
- package/dist/tools/drafts.js +199 -0
- package/dist/tools/drafts.js.map +1 -0
- package/dist/tools/failures.d.ts +46 -0
- package/dist/tools/failures.js +157 -0
- package/dist/tools/failures.js.map +1 -0
- package/dist/tools/format.d.ts +55 -0
- package/dist/tools/format.js +220 -0
- package/dist/tools/format.js.map +1 -0
- package/dist/tools/guidance.d.ts +38 -0
- package/dist/tools/guidance.js +226 -0
- package/dist/tools/guidance.js.map +1 -0
- package/dist/tools/interface.d.ts +28 -0
- package/dist/tools/interface.js +63 -0
- package/dist/tools/interface.js.map +1 -0
- package/dist/tools/labels.d.ts +21 -0
- package/dist/tools/labels.js +92 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/list-folders.d.ts +14 -0
- package/dist/tools/list-folders.js +70 -0
- package/dist/tools/list-folders.js.map +1 -0
- package/dist/tools/messages.d.ts +9 -0
- package/dist/tools/messages.js +221 -0
- package/dist/tools/messages.js.map +1 -0
- package/dist/tools/send.d.ts +29 -0
- package/dist/tools/send.js +236 -0
- package/dist/tools/send.js.map +1 -0
- package/dist/tools/sign-in-required.d.ts +94 -0
- package/dist/tools/sign-in-required.js +168 -0
- package/dist/tools/sign-in-required.js.map +1 -0
- package/dist/web/layout.d.ts +75 -0
- package/dist/web/layout.js +590 -0
- package/dist/web/layout.js.map +1 -0
- package/dist/web/pages.d.ts +79 -0
- package/dist/web/pages.js +284 -0
- package/dist/web/pages.js.map +1 -0
- package/dist/web/sections.d.ts +105 -0
- package/dist/web/sections.js +207 -0
- package/dist/web/sections.js.map +1 -0
- package/dist/web/security.d.ts +122 -0
- package/dist/web/security.js +180 -0
- package/dist/web/security.js.map +1 -0
- package/dist/web/server.d.ts +153 -0
- package/dist/web/server.js +622 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/mail/compose.ts"],"names":[],"mappings":"AA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AC,EAAE,EAAE,CAAC,CAAA;AACxE,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creating and changing drafts.
|
|
3
|
+
*
|
|
4
|
+
* A draft is the safe default: the assistant prepares, the person decides.
|
|
5
|
+
* Nothing in this file sends anything, and nothing in it can. Sending lives in
|
|
6
|
+
* send.ts behind a confirmation.
|
|
7
|
+
*
|
|
8
|
+
* Measured against the Bridge on 31.07.2026:
|
|
9
|
+
*
|
|
10
|
+
* 1. **`APPEND` into "Drafts" works and keeps our Message-ID.** A client-minted
|
|
11
|
+
* id comes back unchanged, so a draft has a stable handle from the moment it
|
|
12
|
+
* is written, without waiting for anything to settle.
|
|
13
|
+
* 2. **Changing a draft is: append the new version, expunge the old one.** That
|
|
14
|
+
* held: the mailbox was left with exactly the new version, unchanged forty
|
|
15
|
+
* seconds later.
|
|
16
|
+
* 3. **An appended message takes about twenty seconds to appear in "All Mail".**
|
|
17
|
+
* It is in its own mailbox immediately. That is why every lookup in here goes
|
|
18
|
+
* to "Drafts" directly and never through the ordinary resolver, which falls
|
|
19
|
+
* back to "All Mail" and would not find a draft written a moment ago.
|
|
20
|
+
* 4. **Proton rewrites the thread headers of anything it stores.** A draft
|
|
21
|
+
* appended with `In-Reply-To` and `References` comes back with `In-Reply-To`
|
|
22
|
+
* gone and `References` replaced by a single `@protonmail.internalid` value.
|
|
23
|
+
* Our own `Message-ID` survives; the chain does not.
|
|
24
|
+
*
|
|
25
|
+
* Point 4 is worth stating plainly rather than burying: **the reference headers
|
|
26
|
+
* written here are correct when they are built and are not what ends up in the
|
|
27
|
+
* stored draft.** They still matter, because Proton reads them to work out which
|
|
28
|
+
* conversation the draft belongs to, but a draft that is stored and sent later
|
|
29
|
+
* carries Proton's idea of the thread and not ours. Sending a reply with headers
|
|
30
|
+
* we control means building it and sending it without storing it in between,
|
|
31
|
+
* which is why replying is also a sending tool and not only a draft tool.
|
|
32
|
+
* Measured on the other side of that fence: a message handed to SMTP keeps its
|
|
33
|
+
* `In-Reply-To`. So the difference is real, and it is a difference between
|
|
34
|
+
* storing and sending rather than a limitation of what we can build.
|
|
35
|
+
*
|
|
36
|
+
* The dangerous line is the expunge in updateDraft. It is the same operation
|
|
37
|
+
* that removes a label, and aimed at the wrong mailbox it deletes mail, so it
|
|
38
|
+
* is guarded twice: the mailbox must be "Drafts", and the message must actually
|
|
39
|
+
* carry the \Draft flag.
|
|
40
|
+
*/
|
|
41
|
+
import type { Connection } from '../bridge/connection.js';
|
|
42
|
+
import { type ListResult } from './messages.js';
|
|
43
|
+
import { type Draft, type Recipient } from './compose.js';
|
|
44
|
+
/** The one mailbox this module writes to. */
|
|
45
|
+
export declare const DRAFTS = "Drafts";
|
|
46
|
+
/**
|
|
47
|
+
* What a caller may hand in. Strings, because that is what a tool receives.
|
|
48
|
+
*
|
|
49
|
+
* `undefined` is spelled out rather than left to the optional marker: under
|
|
50
|
+
* exactOptionalPropertyTypes those are different things, and a tool handler
|
|
51
|
+
* hands over exactly the shape where an absent field is present as undefined.
|
|
52
|
+
*/
|
|
53
|
+
export interface DraftInput {
|
|
54
|
+
to?: string[] | undefined;
|
|
55
|
+
cc?: string[] | undefined;
|
|
56
|
+
bcc?: string[] | undefined;
|
|
57
|
+
subject?: string | undefined;
|
|
58
|
+
text?: string | undefined;
|
|
59
|
+
html?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface DraftResult {
|
|
62
|
+
messageId: string;
|
|
63
|
+
subject: string;
|
|
64
|
+
to: Recipient[];
|
|
65
|
+
cc: Recipient[];
|
|
66
|
+
bcc: Recipient[];
|
|
67
|
+
/** Its uid in "Drafts". Valid until the draft is replaced. */
|
|
68
|
+
uid: number;
|
|
69
|
+
/** Set when a whole message was carried along, as with a forward. */
|
|
70
|
+
carriedAttachments?: string[];
|
|
71
|
+
}
|
|
72
|
+
/** Creates a draft from scratch. */
|
|
73
|
+
export declare function createDraft(connection: Connection, readOnly: boolean, fromAddress: string, input: DraftInput): Promise<DraftResult>;
|
|
74
|
+
/**
|
|
75
|
+
* Replaces a draft with a changed version.
|
|
76
|
+
*
|
|
77
|
+
* Fields that are not named are carried over, so changing a subject does not
|
|
78
|
+
* silently drop the recipients. The new version keeps the same Message-ID, so
|
|
79
|
+
* the identifier a caller already has stays valid.
|
|
80
|
+
*
|
|
81
|
+
* The new version is written before the old one is removed. If the removal
|
|
82
|
+
* fails, the mailbox holds two versions, which is a nuisance; the other order
|
|
83
|
+
* would risk holding none.
|
|
84
|
+
*/
|
|
85
|
+
export declare function updateDraft(connection: Connection, readOnly: boolean, fromAddress: string, messageId: string, changes: DraftInput): Promise<DraftResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Prepares a reply as a draft.
|
|
88
|
+
*
|
|
89
|
+
* The reference headers are the whole point of doing this in the server: a
|
|
90
|
+
* reply without In-Reply-To and References is a new conversation that happens
|
|
91
|
+
* to share a subject, and every mail reader will show it as one.
|
|
92
|
+
*/
|
|
93
|
+
export declare function buildReplyDraft(connection: Connection, fromAddress: string, messageId: string, text: string, options?: {
|
|
94
|
+
all?: boolean;
|
|
95
|
+
mailbox?: string;
|
|
96
|
+
html?: string;
|
|
97
|
+
}): Promise<Draft>;
|
|
98
|
+
/** Prepares a reply and stores it as a draft. */
|
|
99
|
+
export declare function replyDraft(connection: Connection, readOnly: boolean, fromAddress: string, messageId: string, text: string, options?: {
|
|
100
|
+
all?: boolean;
|
|
101
|
+
mailbox?: string;
|
|
102
|
+
html?: string;
|
|
103
|
+
}): Promise<DraftResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Prepares a forward as a draft.
|
|
106
|
+
*
|
|
107
|
+
* When the original carries attachments, the whole original message is attached
|
|
108
|
+
* as `message/rfc822` rather than its parts being taken out and put back. That
|
|
109
|
+
* keeps everything, needs nothing from the local disk, and cannot quietly lose
|
|
110
|
+
* a file the way a re-encoded copy can.
|
|
111
|
+
*/
|
|
112
|
+
export declare function buildForwardDraft(connection: Connection, fromAddress: string, messageId: string, to: string[], text: string, options?: {
|
|
113
|
+
mailbox?: string;
|
|
114
|
+
html?: string;
|
|
115
|
+
}): Promise<Draft>;
|
|
116
|
+
/** Prepares a forward and stores it as a draft. */
|
|
117
|
+
export declare function forwardDraft(connection: Connection, readOnly: boolean, fromAddress: string, messageId: string, to: string[], text: string, options?: {
|
|
118
|
+
mailbox?: string;
|
|
119
|
+
html?: string;
|
|
120
|
+
}): Promise<DraftResult>;
|
|
121
|
+
/** The drafts that are there. Reading only. */
|
|
122
|
+
export declare function listDrafts(connection: Connection, options?: {
|
|
123
|
+
limit?: number;
|
|
124
|
+
offset?: number;
|
|
125
|
+
}): Promise<ListResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Reads a stored draft back as a message ready to be sent.
|
|
128
|
+
*
|
|
129
|
+
* Looked up in "Drafts" alone, and required to carry the draft flag: sending
|
|
130
|
+
* whatever happens to be sitting there under a caller's chosen identifier is
|
|
131
|
+
* not what a caller asking to send a draft means.
|
|
132
|
+
*
|
|
133
|
+
* The thread headers are not recovered, and cannot be. Proton replaces them
|
|
134
|
+
* when it stores a draft, so a reply written as a draft and sent later goes out
|
|
135
|
+
* with Proton's internal thread id rather than the chain it was built with.
|
|
136
|
+
* send_reply exists precisely so that a reply need not take this route.
|
|
137
|
+
*/
|
|
138
|
+
export declare function readDraftForSending(connection: Connection, fromAddress: string, messageId: string): Promise<Draft>;
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creating and changing drafts.
|
|
3
|
+
*
|
|
4
|
+
* A draft is the safe default: the assistant prepares, the person decides.
|
|
5
|
+
* Nothing in this file sends anything, and nothing in it can. Sending lives in
|
|
6
|
+
* send.ts behind a confirmation.
|
|
7
|
+
*
|
|
8
|
+
* Measured against the Bridge on 31.07.2026:
|
|
9
|
+
*
|
|
10
|
+
* 1. **`APPEND` into "Drafts" works and keeps our Message-ID.** A client-minted
|
|
11
|
+
* id comes back unchanged, so a draft has a stable handle from the moment it
|
|
12
|
+
* is written, without waiting for anything to settle.
|
|
13
|
+
* 2. **Changing a draft is: append the new version, expunge the old one.** That
|
|
14
|
+
* held: the mailbox was left with exactly the new version, unchanged forty
|
|
15
|
+
* seconds later.
|
|
16
|
+
* 3. **An appended message takes about twenty seconds to appear in "All Mail".**
|
|
17
|
+
* It is in its own mailbox immediately. That is why every lookup in here goes
|
|
18
|
+
* to "Drafts" directly and never through the ordinary resolver, which falls
|
|
19
|
+
* back to "All Mail" and would not find a draft written a moment ago.
|
|
20
|
+
* 4. **Proton rewrites the thread headers of anything it stores.** A draft
|
|
21
|
+
* appended with `In-Reply-To` and `References` comes back with `In-Reply-To`
|
|
22
|
+
* gone and `References` replaced by a single `@protonmail.internalid` value.
|
|
23
|
+
* Our own `Message-ID` survives; the chain does not.
|
|
24
|
+
*
|
|
25
|
+
* Point 4 is worth stating plainly rather than burying: **the reference headers
|
|
26
|
+
* written here are correct when they are built and are not what ends up in the
|
|
27
|
+
* stored draft.** They still matter, because Proton reads them to work out which
|
|
28
|
+
* conversation the draft belongs to, but a draft that is stored and sent later
|
|
29
|
+
* carries Proton's idea of the thread and not ours. Sending a reply with headers
|
|
30
|
+
* we control means building it and sending it without storing it in between,
|
|
31
|
+
* which is why replying is also a sending tool and not only a draft tool.
|
|
32
|
+
* Measured on the other side of that fence: a message handed to SMTP keeps its
|
|
33
|
+
* `In-Reply-To`. So the difference is real, and it is a difference between
|
|
34
|
+
* storing and sending rather than a limitation of what we can build.
|
|
35
|
+
*
|
|
36
|
+
* The dangerous line is the expunge in updateDraft. It is the same operation
|
|
37
|
+
* that removes a label, and aimed at the wrong mailbox it deletes mail, so it
|
|
38
|
+
* is guarded twice: the mailbox must be "Drafts", and the message must actually
|
|
39
|
+
* carry the \Draft flag.
|
|
40
|
+
*/
|
|
41
|
+
import { BridgeError } from '../bridge/errors.js';
|
|
42
|
+
import { normaliseMessageId, findByMessageId } from './ids.js';
|
|
43
|
+
import { getMessage, listMessages } from './messages.js';
|
|
44
|
+
import { htmlToText } from '../mime/parse.js';
|
|
45
|
+
import { buildMessage, mintMessageId, parseRecipient, parseRecipients, escapeHtml, prefixSubject, quote, quoteAsHtml, quoteBody, } from './compose.js';
|
|
46
|
+
/** The one mailbox this module writes to. */
|
|
47
|
+
export const DRAFTS = 'Drafts';
|
|
48
|
+
/**
|
|
49
|
+
* Guard for the expunge. Nothing outside "Drafts" is ever opened for writing
|
|
50
|
+
* here, because removing the old version of a draft is a deletion, and the same
|
|
51
|
+
* command aimed at a folder would delete mail that nobody meant to lose.
|
|
52
|
+
*/
|
|
53
|
+
function assertDraftMailbox(path) {
|
|
54
|
+
if (path !== DRAFTS) {
|
|
55
|
+
throw new BridgeError(`Refusing to operate on "${path}". This code only ever writes to "${DRAFTS}", because ` +
|
|
56
|
+
'replacing a draft expunges the old version and doing that elsewhere would delete mail.');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function assertWritable(readOnly, what) {
|
|
60
|
+
if (readOnly) {
|
|
61
|
+
throw new BridgeError(`The server is running read-only, so ${what} is refused. ` +
|
|
62
|
+
'This is set by PROTON_MCP_READ_ONLY and the web interface reports it as the current mode.');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A message carries text or markup, never both.
|
|
67
|
+
*
|
|
68
|
+
* Refused rather than resolved by a rule nobody would remember. Measured:
|
|
69
|
+
* Proton keeps the markup and drops the text half of a message that has both,
|
|
70
|
+
* so whichever one this server chose to prefer, the other would silently never
|
|
71
|
+
* arrive.
|
|
72
|
+
*/
|
|
73
|
+
function assertOneBody(input) {
|
|
74
|
+
if (input.html !== undefined && input.text !== undefined) {
|
|
75
|
+
throw new BridgeError('Both a text and a markup body were given. A message carries one or the other: Proton drops ' +
|
|
76
|
+
'the text half of a message that has both, so the half that was confirmed would never ' +
|
|
77
|
+
'arrive. Give whichever one this message is.');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Writes a built message into "Drafts" and returns its new uid. */
|
|
81
|
+
async function appendDraft(connection, raw) {
|
|
82
|
+
const result = await connection.withMailbox(DRAFTS, async (client, status) => {
|
|
83
|
+
assertDraftMailbox(status.path);
|
|
84
|
+
return client.append(DRAFTS, raw, ['\\Draft', '\\Seen'], new Date());
|
|
85
|
+
});
|
|
86
|
+
if (!result || typeof result.uid !== 'number') {
|
|
87
|
+
throw new BridgeError('The Bridge did not confirm where the draft was stored, so it is not certain that it was ' +
|
|
88
|
+
'written. Look in the Drafts mailbox before writing it again.');
|
|
89
|
+
}
|
|
90
|
+
return result.uid;
|
|
91
|
+
}
|
|
92
|
+
/** Finds a draft by its Message-ID, inside "Drafts" and nowhere else. */
|
|
93
|
+
async function findDraft(connection, messageId) {
|
|
94
|
+
return connection.withMailbox(DRAFTS, async (client, status) => {
|
|
95
|
+
if (status.messages === 0)
|
|
96
|
+
return undefined;
|
|
97
|
+
// The same two-attempt lookup as everywhere else. A draft this server wrote
|
|
98
|
+
// always carries proper brackets, but the identifier handed in comes from a
|
|
99
|
+
// listing, and a listing is where the other spelling shows up.
|
|
100
|
+
const uid = await findByMessageId(client, messageId);
|
|
101
|
+
if (uid === undefined)
|
|
102
|
+
return undefined;
|
|
103
|
+
const message = await client.fetchOne(String(uid), { flags: true }, { uid: true });
|
|
104
|
+
return { uid, flags: message && message.flags ? message.flags : new Set() };
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/** Writes a built message into Drafts and describes what was stored. */
|
|
108
|
+
async function store(connection, draft) {
|
|
109
|
+
const raw = await buildMessage(draft, { keepBcc: true });
|
|
110
|
+
const uid = await appendDraft(connection, raw);
|
|
111
|
+
return {
|
|
112
|
+
messageId: draft.messageId,
|
|
113
|
+
subject: draft.subject,
|
|
114
|
+
to: draft.to,
|
|
115
|
+
cc: draft.cc,
|
|
116
|
+
bcc: draft.bcc,
|
|
117
|
+
uid,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Creates a draft from scratch. */
|
|
121
|
+
export async function createDraft(connection, readOnly, fromAddress, input) {
|
|
122
|
+
assertWritable(readOnly, 'creating a draft');
|
|
123
|
+
assertOneBody(input);
|
|
124
|
+
const from = parseRecipient(fromAddress);
|
|
125
|
+
const draft = {
|
|
126
|
+
from,
|
|
127
|
+
to: parseRecipients(input.to),
|
|
128
|
+
cc: parseRecipients(input.cc),
|
|
129
|
+
bcc: parseRecipients(input.bcc),
|
|
130
|
+
subject: input.subject ?? '',
|
|
131
|
+
// With markup, the text is the readable rendering of it rather than a
|
|
132
|
+
// second version of the message. Anything that reads `text` then gets
|
|
133
|
+
// something true, and nothing has to remember which field to look at.
|
|
134
|
+
text: input.html !== undefined ? htmlToText(input.html) : (input.text ?? ''),
|
|
135
|
+
messageId: mintMessageId(from.address),
|
|
136
|
+
...(input.html !== undefined ? { html: input.html } : {}),
|
|
137
|
+
};
|
|
138
|
+
const raw = await buildMessage(draft, { keepBcc: true });
|
|
139
|
+
const uid = await appendDraft(connection, raw);
|
|
140
|
+
return {
|
|
141
|
+
messageId: draft.messageId,
|
|
142
|
+
subject: draft.subject,
|
|
143
|
+
to: draft.to,
|
|
144
|
+
cc: draft.cc,
|
|
145
|
+
bcc: draft.bcc,
|
|
146
|
+
uid,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Replaces a draft with a changed version.
|
|
151
|
+
*
|
|
152
|
+
* Fields that are not named are carried over, so changing a subject does not
|
|
153
|
+
* silently drop the recipients. The new version keeps the same Message-ID, so
|
|
154
|
+
* the identifier a caller already has stays valid.
|
|
155
|
+
*
|
|
156
|
+
* The new version is written before the old one is removed. If the removal
|
|
157
|
+
* fails, the mailbox holds two versions, which is a nuisance; the other order
|
|
158
|
+
* would risk holding none.
|
|
159
|
+
*/
|
|
160
|
+
export async function updateDraft(connection, readOnly, fromAddress, messageId, changes) {
|
|
161
|
+
assertWritable(readOnly, 'changing a draft');
|
|
162
|
+
assertOneBody(changes);
|
|
163
|
+
const id = normaliseMessageId(messageId);
|
|
164
|
+
const existing = await findDraft(connection, id);
|
|
165
|
+
if (!existing) {
|
|
166
|
+
throw new BridgeError(`No draft with the id ${id} is in "${DRAFTS}". Use list_drafts to see the drafts that are ` +
|
|
167
|
+
'there. A draft that has been sent or moved is no longer a draft.');
|
|
168
|
+
}
|
|
169
|
+
// The second guard. A message without the flag is not a draft, and this
|
|
170
|
+
// function is about to delete whatever it was pointed at.
|
|
171
|
+
if (!existing.flags.has('\\Draft')) {
|
|
172
|
+
throw new BridgeError(`The message ${id} is in "${DRAFTS}" but does not carry the draft flag, so it is not treated ` +
|
|
173
|
+
'as a draft. Refusing to replace it, because replacing means deleting the old version.');
|
|
174
|
+
}
|
|
175
|
+
const current = await getMessage(connection, id, { hint: DRAFTS });
|
|
176
|
+
const from = parseRecipient(fromAddress);
|
|
177
|
+
const draft = {
|
|
178
|
+
from,
|
|
179
|
+
to: changes.to === undefined ? current.to : parseRecipients(changes.to),
|
|
180
|
+
cc: changes.cc === undefined ? current.cc : parseRecipients(changes.cc),
|
|
181
|
+
// Drafts are stored with the blind copies kept, so they can be carried
|
|
182
|
+
// over here. A delivered message never carries them, which is why this is
|
|
183
|
+
// only ever true for a draft this server wrote.
|
|
184
|
+
bcc: changes.bcc === undefined ? current.bcc : parseRecipients(changes.bcc),
|
|
185
|
+
subject: changes.subject === undefined ? current.subject : changes.subject,
|
|
186
|
+
...markupOf(changes, current),
|
|
187
|
+
messageId: id,
|
|
188
|
+
};
|
|
189
|
+
const raw = await buildMessage(draft, { keepBcc: true });
|
|
190
|
+
const uid = await appendDraft(connection, raw);
|
|
191
|
+
await connection.withMailbox(DRAFTS, async (client, status) => {
|
|
192
|
+
// Guarded again, in the line before the delete rather than twenty lines
|
|
193
|
+
// above it. This is the line that removes a message.
|
|
194
|
+
assertDraftMailbox(status.path);
|
|
195
|
+
await client.messageDelete(String(existing.uid), { uid: true });
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
messageId: id,
|
|
199
|
+
subject: draft.subject,
|
|
200
|
+
to: draft.to,
|
|
201
|
+
cc: draft.cc,
|
|
202
|
+
bcc: draft.bcc,
|
|
203
|
+
uid,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Which body a changed draft ends up with.
|
|
208
|
+
*
|
|
209
|
+
* Giving markup replaces the whole body, and so does giving text: a draft that
|
|
210
|
+
* was markup and is changed to text is now text. Naming neither carries over
|
|
211
|
+
* what was there, markup included, which is what makes changing only the
|
|
212
|
+
* subject of a formatted draft leave the formatting alone.
|
|
213
|
+
*/
|
|
214
|
+
function markupOf(changes, current) {
|
|
215
|
+
if (changes.html !== undefined)
|
|
216
|
+
return { text: htmlToText(changes.html), html: changes.html };
|
|
217
|
+
if (changes.text !== undefined)
|
|
218
|
+
return { text: changes.text };
|
|
219
|
+
return current.html !== undefined
|
|
220
|
+
? { text: current.text, html: current.html }
|
|
221
|
+
: { text: current.text };
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The body of a reply, with the original quoted below it.
|
|
225
|
+
*
|
|
226
|
+
* When the new part is markup, the quote is markup as well, and it is built
|
|
227
|
+
* from the original's **text** rather than from its markup. The reasoning is in
|
|
228
|
+
* quoteAsHtml, and it is worth repeating in one line here because it is the
|
|
229
|
+
* question anyone will ask when they read this: carrying a stranger's markup
|
|
230
|
+
* into a message sent under this account's name would mean either refusing to
|
|
231
|
+
* reply to ordinary HTML mail, or forwarding links whose targets nobody wrote.
|
|
232
|
+
*/
|
|
233
|
+
function composeWithQuote(text, html, original) {
|
|
234
|
+
if (html === undefined)
|
|
235
|
+
return { text: `${text}${quote(original)}` };
|
|
236
|
+
const quoted = quoteAsHtml(original);
|
|
237
|
+
return { text: htmlToText(html + quoted), html, quotedHtml: quoted };
|
|
238
|
+
}
|
|
239
|
+
/** The thread headers of a message, which a reply has to carry on. */
|
|
240
|
+
async function threadHeaders(connection, path, uid) {
|
|
241
|
+
const raw = await connection.withMailbox(path, async (client) => {
|
|
242
|
+
const message = await client.fetchOne(String(uid), { headers: ['message-id', 'references', 'in-reply-to'] }, { uid: true });
|
|
243
|
+
return message && message.headers ? message.headers.toString('utf8') : '';
|
|
244
|
+
});
|
|
245
|
+
const value = (name) => {
|
|
246
|
+
// Headers may be folded over several lines, so continuation lines count.
|
|
247
|
+
const match = new RegExp(`^${name}:([\\s\\S]*?)(?=\\r?\\n[^\\s]|$)`, 'im').exec(raw);
|
|
248
|
+
return match ? match[1].replace(/\s+/g, ' ').trim() : undefined;
|
|
249
|
+
};
|
|
250
|
+
const ids = (text) => text ? (text.match(/<[^<>\s]+>/g) ?? []) : [];
|
|
251
|
+
const own = ids(value('message-id'))[0];
|
|
252
|
+
const chain = [...ids(value('references')), ...ids(value('in-reply-to'))];
|
|
253
|
+
// Duplicates are common once In-Reply-To repeats the last entry of References.
|
|
254
|
+
const references = [...new Set(chain)];
|
|
255
|
+
return own ? { messageId: own, references } : { references };
|
|
256
|
+
}
|
|
257
|
+
/** Everything except our own address, so a reply does not go back to us. */
|
|
258
|
+
function withoutSelf(list, self) {
|
|
259
|
+
const mine = self.toLowerCase();
|
|
260
|
+
const seen = new Set();
|
|
261
|
+
return list.filter((r) => {
|
|
262
|
+
const key = r.address.toLowerCase();
|
|
263
|
+
if (key === mine || seen.has(key))
|
|
264
|
+
return false;
|
|
265
|
+
seen.add(key);
|
|
266
|
+
return true;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Prepares a reply as a draft.
|
|
271
|
+
*
|
|
272
|
+
* The reference headers are the whole point of doing this in the server: a
|
|
273
|
+
* reply without In-Reply-To and References is a new conversation that happens
|
|
274
|
+
* to share a subject, and every mail reader will show it as one.
|
|
275
|
+
*/
|
|
276
|
+
export async function buildReplyDraft(connection, fromAddress, messageId, text, options = {}) {
|
|
277
|
+
const original = await getMessage(connection, messageId, {
|
|
278
|
+
...(options.mailbox ? { hint: options.mailbox } : {}),
|
|
279
|
+
});
|
|
280
|
+
const thread = await threadHeaders(connection, original.path, await uidOf(connection, original.path, original.messageId));
|
|
281
|
+
const from = parseRecipient(fromAddress);
|
|
282
|
+
// Reply-To wins over From. A sender who set it asked for answers elsewhere.
|
|
283
|
+
const primary = original.replyTo.length ? original.replyTo : original.from;
|
|
284
|
+
const to = withoutSelf(primary, from.address);
|
|
285
|
+
const cc = options.all
|
|
286
|
+
? withoutSelf([...original.to, ...original.cc].filter((r) => !to.some((t) => t.address.toLowerCase() === r.address.toLowerCase())), from.address)
|
|
287
|
+
: [];
|
|
288
|
+
if (to.length === 0 && cc.length === 0) {
|
|
289
|
+
throw new BridgeError('There is nobody to reply to: the only address on the message is your own. ' +
|
|
290
|
+
'Use create_draft with an explicit recipient instead.');
|
|
291
|
+
}
|
|
292
|
+
const body = composeWithQuote(text, options.html, original);
|
|
293
|
+
const draft = {
|
|
294
|
+
from,
|
|
295
|
+
to,
|
|
296
|
+
cc,
|
|
297
|
+
bcc: [],
|
|
298
|
+
subject: prefixSubject(original.subject, 'Re'),
|
|
299
|
+
...body,
|
|
300
|
+
messageId: mintMessageId(from.address),
|
|
301
|
+
...(thread.messageId ? { inReplyTo: thread.messageId } : {}),
|
|
302
|
+
references: [...thread.references, ...(thread.messageId ? [thread.messageId] : [])],
|
|
303
|
+
};
|
|
304
|
+
return draft;
|
|
305
|
+
}
|
|
306
|
+
/** Prepares a reply and stores it as a draft. */
|
|
307
|
+
export async function replyDraft(connection, readOnly, fromAddress, messageId, text, options = {}) {
|
|
308
|
+
assertWritable(readOnly, 'creating a reply draft');
|
|
309
|
+
const draft = await buildReplyDraft(connection, fromAddress, messageId, text, options);
|
|
310
|
+
return store(connection, draft);
|
|
311
|
+
}
|
|
312
|
+
/** The uid of a message inside one mailbox. */
|
|
313
|
+
async function uidOf(connection, path, messageId) {
|
|
314
|
+
const uid = await connection.withMailbox(path, async (client, status) => {
|
|
315
|
+
if (status.messages === 0)
|
|
316
|
+
return undefined;
|
|
317
|
+
const hits = await client.search({ header: { 'message-id': messageId } }, { uid: true });
|
|
318
|
+
return Array.isArray(hits) && hits.length ? Math.max(...hits) : undefined;
|
|
319
|
+
});
|
|
320
|
+
if (uid === undefined) {
|
|
321
|
+
throw new BridgeError(`The message ${messageId} is no longer in "${path}".`);
|
|
322
|
+
}
|
|
323
|
+
return uid;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Prepares a forward as a draft.
|
|
327
|
+
*
|
|
328
|
+
* When the original carries attachments, the whole original message is attached
|
|
329
|
+
* as `message/rfc822` rather than its parts being taken out and put back. That
|
|
330
|
+
* keeps everything, needs nothing from the local disk, and cannot quietly lose
|
|
331
|
+
* a file the way a re-encoded copy can.
|
|
332
|
+
*/
|
|
333
|
+
export async function buildForwardDraft(connection, fromAddress, messageId, to, text, options = {}) {
|
|
334
|
+
const original = await getMessage(connection, messageId, {
|
|
335
|
+
...(options.mailbox ? { hint: options.mailbox } : {}),
|
|
336
|
+
});
|
|
337
|
+
const from = parseRecipient(fromAddress);
|
|
338
|
+
const recipients = parseRecipients(to);
|
|
339
|
+
if (recipients.length === 0) {
|
|
340
|
+
throw new BridgeError('A forward needs at least one recipient.');
|
|
341
|
+
}
|
|
342
|
+
const header = [
|
|
343
|
+
'',
|
|
344
|
+
'---------- Forwarded message ----------',
|
|
345
|
+
`From: ${original.from.map((f) => (f.name ? `${f.name} <${f.address}>` : f.address)).join(', ')}`,
|
|
346
|
+
`Date: ${original.date ? original.date.toISOString().slice(0, 16).replace('T', ' ') : 'unknown'}`,
|
|
347
|
+
`Subject: ${original.subject || '(no subject)'}`,
|
|
348
|
+
`To: ${original.to.map((t) => t.address).join(', ') || '(none)'}`,
|
|
349
|
+
'',
|
|
350
|
+
].join('\n');
|
|
351
|
+
const draft = {
|
|
352
|
+
from,
|
|
353
|
+
to: recipients,
|
|
354
|
+
cc: [],
|
|
355
|
+
bcc: [],
|
|
356
|
+
subject: prefixSubject(original.subject, 'Fwd'),
|
|
357
|
+
...(options.html === undefined
|
|
358
|
+
? { text: `${text}\n${header}${original.text}` }
|
|
359
|
+
: (() => {
|
|
360
|
+
const head = `<p>---------- Forwarded message ----------<br>` +
|
|
361
|
+
`From: ${escapeHtml(original.from.map((f) => (f.name ? `${f.name} <${f.address}>` : f.address)).join(', '))}<br>` +
|
|
362
|
+
`Date: ${escapeHtml(original.date ? original.date.toISOString().slice(0, 16).replace('T', ' ') : 'unknown')}<br>` +
|
|
363
|
+
`Subject: ${escapeHtml(original.subject || '(no subject)')}<br>` +
|
|
364
|
+
`To: ${escapeHtml(original.to.map((t) => t.address).join(', ') || '(none)')}</p>`;
|
|
365
|
+
// The same preparation as a reply: the original as it was, minus what
|
|
366
|
+
// would reach out of the quote.
|
|
367
|
+
const quoted = head + quoteBody(original);
|
|
368
|
+
return {
|
|
369
|
+
text: htmlToText(options.html + quoted),
|
|
370
|
+
html: options.html,
|
|
371
|
+
quotedHtml: quoted,
|
|
372
|
+
};
|
|
373
|
+
})()),
|
|
374
|
+
messageId: mintMessageId(from.address),
|
|
375
|
+
};
|
|
376
|
+
// Only when there is something a quoted body would lose.
|
|
377
|
+
if (original.attachments.length > 0) {
|
|
378
|
+
const uid = await uidOf(connection, original.path, original.messageId);
|
|
379
|
+
const source = await connection.withMailbox(original.path, async (client) => {
|
|
380
|
+
const message = await client.fetchOne(String(uid), { source: true }, { uid: true });
|
|
381
|
+
return message && message.source ? message.source : undefined;
|
|
382
|
+
});
|
|
383
|
+
if (source) {
|
|
384
|
+
draft.attachedMessage = {
|
|
385
|
+
filename: `${(original.subject || 'message').replace(/[^\w. -]/g, '_').slice(0, 60)}.eml`,
|
|
386
|
+
raw: source,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return draft;
|
|
391
|
+
}
|
|
392
|
+
/** Prepares a forward and stores it as a draft. */
|
|
393
|
+
export async function forwardDraft(connection, readOnly, fromAddress, messageId, to, text, options = {}) {
|
|
394
|
+
assertWritable(readOnly, 'creating a forward draft');
|
|
395
|
+
const draft = await buildForwardDraft(connection, fromAddress, messageId, to, text, options);
|
|
396
|
+
const stored = await store(connection, draft);
|
|
397
|
+
return draft.attachedMessage
|
|
398
|
+
? { ...stored, carriedAttachments: [draft.attachedMessage.filename] }
|
|
399
|
+
: stored;
|
|
400
|
+
}
|
|
401
|
+
/** The drafts that are there. Reading only. */
|
|
402
|
+
export async function listDrafts(connection, options = {}) {
|
|
403
|
+
return listMessages(connection, DRAFTS, {
|
|
404
|
+
limit: options.limit ?? 25,
|
|
405
|
+
offset: options.offset ?? 0,
|
|
406
|
+
unreadOnly: false,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Reads a stored draft back as a message ready to be sent.
|
|
411
|
+
*
|
|
412
|
+
* Looked up in "Drafts" alone, and required to carry the draft flag: sending
|
|
413
|
+
* whatever happens to be sitting there under a caller's chosen identifier is
|
|
414
|
+
* not what a caller asking to send a draft means.
|
|
415
|
+
*
|
|
416
|
+
* The thread headers are not recovered, and cannot be. Proton replaces them
|
|
417
|
+
* when it stores a draft, so a reply written as a draft and sent later goes out
|
|
418
|
+
* with Proton's internal thread id rather than the chain it was built with.
|
|
419
|
+
* send_reply exists precisely so that a reply need not take this route.
|
|
420
|
+
*/
|
|
421
|
+
export async function readDraftForSending(connection, fromAddress, messageId) {
|
|
422
|
+
const id = normaliseMessageId(messageId);
|
|
423
|
+
const existing = await findDraft(connection, id);
|
|
424
|
+
if (!existing) {
|
|
425
|
+
throw new BridgeError(`No draft with the id ${id} is in "${DRAFTS}". Use list_drafts to see what is there.`);
|
|
426
|
+
}
|
|
427
|
+
if (!existing.flags.has('\\Draft')) {
|
|
428
|
+
throw new BridgeError(`The message ${id} is in "${DRAFTS}" but does not carry the draft flag, so it is not a ` +
|
|
429
|
+
'draft. Refusing to send it.');
|
|
430
|
+
}
|
|
431
|
+
const stored = await getMessage(connection, id, { hint: DRAFTS });
|
|
432
|
+
if (stored.to.length === 0 && stored.cc.length === 0 && stored.bcc.length === 0) {
|
|
433
|
+
throw new BridgeError(`The draft ${id} has no recipient, so there is nobody to send it to. Add one with ` +
|
|
434
|
+
'update_draft first.');
|
|
435
|
+
}
|
|
436
|
+
return {
|
|
437
|
+
from: parseRecipient(fromAddress),
|
|
438
|
+
to: stored.to,
|
|
439
|
+
cc: stored.cc,
|
|
440
|
+
bcc: stored.bcc,
|
|
441
|
+
subject: stored.subject,
|
|
442
|
+
text: stored.text,
|
|
443
|
+
messageId: id,
|
|
444
|
+
// A draft written as markup is sent as the markup it was. Converting it to
|
|
445
|
+
// text and back would deliver something its author never wrote.
|
|
446
|
+
...(stored.html !== undefined ? { html: stored.html } : {}),
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/mail/drafts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAmB,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,SAAS,GAGV,MAAM,cAAc,CAAA;AAErB,6CAA6C;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAA;AAE9B;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,WAAW,CACnB,2BAA2B,IAAI,qCAAqC,MAAM,aAAa;YACrF,wFAAwF,CAC3F,CAAA;IACH,CAAC;AACH,CAAC;AAED,SAAS,cA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