@rndmjoker/proton-mcp 0.4.4 → 0.4.7

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 (54) hide show
  1. package/README.md +36 -12
  2. package/dist/mail/compose.d.ts +50 -24
  3. package/dist/mail/compose.js +62 -31
  4. package/dist/mail/compose.js.map +1 -1
  5. package/dist/mail/ids.d.ts +5 -1
  6. package/dist/mail/ids.js.map +1 -1
  7. package/dist/mail/markup.d.ts +66 -4
  8. package/dist/mail/markup.js +239 -41
  9. package/dist/mail/markup.js.map +1 -1
  10. package/dist/mail/messages.d.ts +5 -1
  11. package/dist/mail/messages.js.map +1 -1
  12. package/dist/mail/search.d.ts +8 -2
  13. package/dist/mail/search.js.map +1 -1
  14. package/dist/server.js +6 -0
  15. package/dist/server.js.map +1 -1
  16. package/dist/tools/confirm.d.ts +38 -5
  17. package/dist/tools/confirm.js +95 -49
  18. package/dist/tools/confirm.js.map +1 -1
  19. package/dist/tools/drafts.js +43 -9
  20. package/dist/tools/drafts.js.map +1 -1
  21. package/dist/tools/failures.d.ts +12 -0
  22. package/dist/tools/failures.js +24 -0
  23. package/dist/tools/failures.js.map +1 -1
  24. package/dist/tools/format.d.ts +4 -0
  25. package/dist/tools/format.js +76 -12
  26. package/dist/tools/format.js.map +1 -1
  27. package/dist/tools/guidance.js +61 -14
  28. package/dist/tools/guidance.js.map +1 -1
  29. package/dist/tools/interface.js +7 -3
  30. package/dist/tools/interface.js.map +1 -1
  31. package/dist/tools/pending-view.d.ts +46 -0
  32. package/dist/tools/pending-view.js +63 -0
  33. package/dist/tools/pending-view.js.map +1 -0
  34. package/dist/tools/preview.d.ts +70 -0
  35. package/dist/tools/preview.js +108 -0
  36. package/dist/tools/preview.js.map +1 -0
  37. package/dist/tools/send.js +53 -11
  38. package/dist/tools/send.js.map +1 -1
  39. package/dist/tools/updates.d.ts +53 -0
  40. package/dist/tools/updates.js +134 -0
  41. package/dist/tools/updates.js.map +1 -0
  42. package/dist/web/layout.js +34 -0
  43. package/dist/web/layout.js.map +1 -1
  44. package/dist/web/pending.d.ts +72 -0
  45. package/dist/web/pending.js +196 -0
  46. package/dist/web/pending.js.map +1 -0
  47. package/dist/web/sections.js +6 -1
  48. package/dist/web/sections.js.map +1 -1
  49. package/dist/web/security.js +10 -0
  50. package/dist/web/security.js.map +1 -1
  51. package/dist/web/server.d.ts +14 -1
  52. package/dist/web/server.js +39 -0
  53. package/dist/web/server.js.map +1 -1
  54. package/package.json +4 -1
package/README.md CHANGED
@@ -35,9 +35,13 @@ This server therefore runs on your machine as well, started by the AI client as
35
35
  | `send_reply` | Replies and sends, keeping the conversation intact |
36
36
  | `send_forward` | Forwards and sends, attachments and all |
37
37
  | `send_draft` | Sends a draft that is already written |
38
+ | `open_configuration` | Hands back the address of the local web interface, with the token that opens it |
39
+ | `check_for_updates` | Asks npm whether a newer version exists. The only thing here that contacts anything but your own machine, and only when called |
38
40
 
39
41
  Every tool that composes a message takes either `text` or `html`, never both: Proton drops the plain text half of a message that carries markup, so the half you confirmed would be the half that never arrived.
40
42
 
43
+ They also take a `markupLevel`. At **`standard`**, the default, a message may use colour, background, font, alignment, spacing, borders and size, plus links, images, tables and lists; anything else is refused with a reason rather than quietly removed. At **`extended`** every CSS property is permitted, including ones that can put content out of sight. Nothing is refused there for being a style: what was used is reported instead, the confirmation carries a warning telling you to open the preview, and the preview names every property, its value and the element it sat on. A proper button needs `extended`, because a link cannot fill its own padding without `display: inline-block`.
44
+
41
45
  The server also tells an assistant how it works, so the rules are not something a model has to infer from failures. A short text travels with every connection naming the four things that go wrong quietly, and two longer guides can be read on demand: `proton-mcp://guide/writing` for composing messages and `proton-mcp://guide/bridge` for the measured behaviour of the Bridge itself.
42
46
 
43
47
  Underneath: a held IMAP connection that recovers from a Bridge restart, stable identifiers based on the Message-ID, HTML to text conversion, filtering of the public key Proton attaches to every sent message, and a character budget so a single message cannot exhaust a context window.
@@ -52,6 +56,8 @@ There is also a **local web interface**, on `127.0.0.1` only, running for as lon
52
56
  | Credentials | Where the Bridge password is kept, and signing out, which clears it from every store at once |
53
57
  | Activity | What is running and for how long, plus the last 50 finished calls. Tool names and timings only, never arguments |
54
58
 
59
+ One more appears only while a message is waiting for you to confirm it, linked from that question: the message rendered as the recipient will see it, every address in full, every alt text, every attachment. It is the one place this interface shows mail, and it carries no confirm button by design.
60
+
55
61
  Before signing in there are two more: the sign-in form, where the address and Bridge password go into the browser rather than into a client configuration or a conversation, with four places to keep the password and the cost of each stated; and the unlock page, which after a restart asks for the master password alone, since the Bridge password is already on disk.
56
62
 
57
63
  **None of it uses JavaScript.** The Content-Security-Policy forbids it, so navigation is links and anything interactive is a form control. It follows the system light or dark setting, which needs no script either.
@@ -66,7 +72,7 @@ This table says what the server cannot do today. The issue behind each entry say
66
72
  | :--- | :--- |
67
73
  | Attachments composed from files on this machine | [#17](https://github.com/RndmJoker/proton-mcp/issues/17) |
68
74
  | Choosing per tool what an assistant may do | [#19](https://github.com/RndmJoker/proton-mcp/issues/19) |
69
- | Choosing how much markup a message may carry | [#24](https://github.com/RndmJoker/proton-mcp/issues/24) |
75
+ | Choosing in the interface how much markup a message may carry. The levels exist and a caller picks one per message; what is missing is a ceiling the caller cannot raise | [#24](https://github.com/RndmJoker/proton-mcp/issues/24) |
70
76
  | A fixed extra recipient the assistant cannot remove | [#18](https://github.com/RndmJoker/proton-mcp/issues/18) |
71
77
 
72
78
  **Binary attachments** are missing from that table on purpose. They are not an unfinished feature waiting for its turn: `get_attachment` refuses anything that is not text and says why. Handing one over would mean either base64 in the context window, which is unusable, or writing decrypted content to your disk, which this server does not do. Changing that needs a decision first, not an implementation, so there is nothing to track yet.
@@ -100,6 +106,16 @@ Fetch https://raw.githubusercontent.com/RndmJoker/proton-mcp/main/prompt.md and
100
106
 
101
107
  It checks the prerequisites, registers the server with your client and tells you what to do next. **It never asks for your Bridge password** and cannot: that goes into the local web interface, in your browser, and nowhere else.
102
108
 
109
+ You can also just ask your assistant whether there is an update: the server has a `check_for_updates` tool that asks npm and reports what to do. It is the one thing in here that contacts anything other than your own machine, it runs only when called, it sends nothing about you, and it installs nothing.
110
+
111
+ Or hand over the guide, the same way as for the installation:
112
+
113
+ ```
114
+ Fetch https://raw.githubusercontent.com/RndmJoker/proton-mcp/main/update.md and follow it
115
+ ```
116
+
117
+ It works out how you installed it, since the three ways look identical from the outside and are updated differently, and it reminds you that the client has to be restarted. Nothing has to be set up again: credentials, the pinned certificate and the ports all survive.
118
+
103
119
  ### From npm
104
120
 
105
121
  ```bash
@@ -238,9 +254,9 @@ You should see your system mailboxes. If instead you get a message saying the Br
238
254
 
239
255
  The content of someone else's email is text written by strangers, and it is handed to a language model that can call tools. A crafted message may try to instruct the assistant. This server assumes that will happen:
240
256
 
241
- - **Message content is marked as untrusted** in every answer, enclosed in explicit markers and separated from anything the server itself says.
257
+ - **Message content is marked as untrusted** in every answer, enclosed in markers and separated from anything the server itself says. The markers carry a label drawn per answer, because a fixed one is written down in this repository: a sender could put the closing marker in the body and have everything after it read as though the server wrote it. A label that changes every time cannot be copied. For the same reason a subject, a display name or an attachment name never breaks across lines, however many line breaks it was sent with; the break is shown, not removed.
242
258
  - **Nothing is filtered out of the content** and no attempt is made to detect attacks. Such filters pretend to offer safety they cannot deliver.
243
- - **Sending will always require your confirmation**, enforced in the server rather than in a system prompt. There will be no switch to turn it off. Until sending exists at all, there is nothing to confirm.
259
+ - **Sending always requires your confirmation**, enforced in the server rather than in a system prompt. There is no switch to turn it off, and a client that cannot ask the question cannot send.
244
260
  - **There will be no permanent deletion**, and no tools for filters, forwarding, account or key settings. A hijacked session must not be able to leave behind lasting access.
245
261
  - **HTML is never passed through raw** and external content is never fetched. Tracking pixels stay ineffective.
246
262
  - **No message ever touches your disk.** No cache, no index, no copies. Anything this server wrote down would be your mail in plain text, outside the encryption you pay Proton for.
@@ -258,14 +274,17 @@ Every tool that changes something is bounded on purpose:
258
274
 
259
275
  **A draft is the safe default.** The assistant prepares, you decide.
260
276
 
261
- **Messages can be plain text or formatted.** A formatted one may use headings, paragraphs, emphasis, lists, tables, links and images, with colour, font, alignment, spacing and borders. Anything outside that set is refused with a reason rather than quietly removed, because a message that was silently altered is no longer the message anyone agreed to.
277
+ **Messages can be plain text or formatted.** A formatted one may use headings, paragraphs, emphasis, lists, tables, links and images, with colour, font, alignment, spacing and borders. **Images work the ordinary way**: an `<img>` at an `https` address, at any size, inside a link, animated if you like. Only a `data:` address is refused, because it would carry a whole file inside the markup where nothing lists it.
278
+
279
+ Anything outside the permitted set is refused with a reason rather than quietly removed, because a message that was silently altered is no longer the message anyone agreed to. **The refusal names the way forward**, which is usually `markupLevel: "extended"`.
262
280
 
263
- Formatting changes what a confirmation has to show, and that is the interesting part. In plain text a link's visible text and its target are the same string, so showing you the body shows you everything. In markup they are two strings, which is the shape of every phishing mail ever written. So the confirmation for a formatted message adds two blocks that are never shortened:
281
+ Formatting changes what a confirmation has to show, and that is the interesting part. In plain text a link's visible text and its target are the same string, so showing you the body shows you everything. In markup they are two strings, which is the shape of every phishing mail ever written. Neither fits in a dialog, so both live on the preview page, never shortened:
264
282
 
265
283
  - **Every address in the message**, links and images alike, each with the text it is shown as.
266
- - **Text a recipient can read that the body preview does not show.** Measured: an image's alt text never appears in the converted body, and mail clients block remote images by default, so the alt text is frequently what the recipient actually reads. That was a way past the confirmation, and it is closed.
284
+ - **Text a recipient can read that the body does not show.** Measured: an image's alt text never appears in the converted body, and mail clients block remote images by default, so the alt text is frequently what the recipient actually reads. That was a way past the confirmation, and it is closed.
285
+ - **Every property beyond ordinary formatting**, when `extended` was used, with the ones that really put something out of sight marked as such.
267
286
 
268
- The set of permitted markup leaves out `style`, `script`, `noscript`, `textarea` and `head` by not listing them. Those are the elements whose content the preview and a mail client disagree about, and a list of what is allowed refuses them without anyone having had to think of them first. Attachments from files on this machine are deliberately not supported: a path named by a model, read by the server and carried out by the next confirmation is not a feature, it is a way out for anything on your disk. Forwarding loses nothing all the same, because the original message travels along whole.
287
+ What no level permits is `style` blocks, `script`, event handlers, `data:` addresses and comments. Comments look inert and are not: Outlook runs conditional ones, so a `<style>` block inside a comment reaches those recipients as markup while the confirmation and the preview see a comment. Addresses are checked wherever they appear, a CSS `background: url(...)` included, and every one of them is listed on the preview page. The line runs between describing a document and running inside it or reaching out of it: a `<style>` in the quote of a reply restyles the answer written above it, and 66 percent of real formatted mail carries one. Attachments from files on this machine are deliberately not supported either: a path named by a model, read by the server and carried out by the next confirmation is not a feature, it is a way out for anything on your disk. Forwarding loses nothing all the same, because the original message travels along whole, embedded images included.
269
288
 
270
289
  One thing worth knowing about drafts: Proton rewrites the thread headers of anything it stores. A reply is built with `In-Reply-To` and `References`, and what comes back has neither, only Proton's own internal thread id. Threading a stored draft is therefore Proton's business rather than this server's.
271
290
 
@@ -275,7 +294,10 @@ Writes need a moment to settle. A move takes roughly fifteen seconds to reconcil
275
294
 
276
295
  Mail is text written by strangers, handed to a model that can call tools. A message can politely ask to be forwarded somewhere, and other projects answer that with a line in a system prompt. **A system prompt is not a security boundary.** This one lives in the server:
277
296
 
278
- - **Nothing is sent without a person saying yes.** The first call never sends. It returns a question through your client showing the final recipients separated into To, Cc and Bcc, the subject, and the first lines. Only the second call, carrying your answer, sends.
297
+ - **Nothing is sent without a person saying yes.** The first call never sends. It returns a question through your client naming the sender, every recipient separated into To, Cc and Bcc, and the subject. Only the second call, carrying your answer, sends.
298
+ - **The question is short, and the message is somewhere with room.** It carries no part of the message itself; it links to a page in the local interface where you can read it as the recipient will see it, with every address in full. That split exists because the question used to grow with the message: 74 lines for a newsletter-shaped one, at which point the confirm button sat below the bottom of the dialog and nothing could be sent at all.
299
+ - **Recipients are never summarised**, however many there are. Seeing three of eight would mean agreeing to a send to five strangers.
300
+ - **The answer goes through your client, never through the browser.** That page has no confirm button and will not get one: the address of the interface reaches your assistant, so a control there could be operated by the thing it is supervising.
279
301
  - **There is no setting that turns the question off.** Not an environment variable, not an argument, not a mode.
280
302
  - **A client that cannot ask cannot send.** If your client does not support form elicitation, sending is refused and you are pointed at drafts instead. That is deliberately different from the sign-in prompt, which falls back to text: the worst outcome there is an inconvenience, and here it is a message that cannot be recalled. What counts as "can ask" is the capability your client declares, read from the request when the protocol revision carries it there and from the handshake otherwise.
281
303
  - **Your yes covers one specific message.** A fingerprint of the sender, every recipient, the subject and the body is sealed with an HMAC whose key exists only in the running process, and it travels with the question. On the way back the fingerprint is recomputed from what is being asked for now. If a single address was added in between, nothing is sent. A confirmation is also bound to the tool that asked, so one cannot be reused for another.
@@ -310,7 +332,7 @@ It binds to `127.0.0.1` and there is no option to change that. It is not remote
310
332
  - **An Origin check and a per-action CSRF token** on everything that changes something, so a token for one action cannot be replayed against another.
311
333
  - **A strict Content-Security-Policy.** Nothing may be loaded from anywhere and nothing can reach the network. The interface also serves no files from disk at all, which removes path traversal as a category rather than guarding against it.
312
334
 
313
- It shows no message content, by design. It is for configuration and state, not a mail client.
335
+ It shows no message content, with exactly one exception: a message waiting for you to confirm it. That page renders it as the recipient will see it, and lists every address, alt text and attachment. The message is held in memory only, dropped as soon as you answer either way, and gone after fifteen minutes. Somebody else's markup, which a reply carries as its quote, is rendered in a frame with no permissions at all, and images from the internet are not loaded: a tracking pixel must not tell its author that you looked.
314
336
 
315
337
  ### What you actually expose
316
338
 
@@ -342,14 +364,14 @@ The one moment this cannot protect you is the very first connection, which is wh
342
364
  | Area | Choice |
343
365
  | :--- | :--- |
344
366
  | Language | TypeScript, Node.js 24 or newer |
345
- | MCP | `@modelcontextprotocol/server` v2, specification 2026-07-28 |
367
+ | MCP | `@modelcontextprotocol/server` v2. Its newest protocol revision is 2025-11-25; the parts of 2026-07-28 this server prepares for are read defensively, see the comment in `src/tools/capabilities.ts` |
346
368
  | IMAP | `imapflow` |
347
369
  | MIME | `mailparser`, `html-to-text` |
348
- | SMTP | `nodemailer`, for sending once it exists |
370
+ | SMTP | `nodemailer` |
349
371
  | Schemas | `zod` |
350
372
  | Tests | Vitest, `node` environment |
351
373
 
352
- Every dependency is MIT or MIT-0, except `deepmerge-ts` which is BSD-3-Clause. All permissive.
374
+ Every dependency that ships is permissive: mostly MIT, with MIT-0 (`nodemailer`), BSD-2-Clause (the `htmlparser2` family), BSD-3-Clause (`deepmerge-ts`), ISC (`split2`) and one dual `MIT OR EUPL-1.1+` (`@zone-eu/mailsplit`). Development dependencies add Apache-2.0 and MPL-2.0.
353
375
 
354
376
  ```bash
355
377
  npm run build # compile into dist/
@@ -372,6 +394,8 @@ src/
372
394
  ├── tools/ the MCP tools and their output formatting
373
395
  ├── web/ the local interface and its security layer
374
396
  ├── activity.ts what is running and what ran, in memory only
397
+ ├── config.ts the environment variables, read once at startup
398
+ ├── in-flight.ts the counter that holds shutdown until answers are out
375
399
  ├── session.ts whether we are signed in, and where from
376
400
  ├── settings.ts the Bridge ports, when changed in the interface
377
401
  └── server.ts entry point and transport
@@ -11,7 +11,7 @@
11
11
  * carries it outside. Which paths may be reached is its own decision, not a
12
12
  * side effect of being able to write a draft.
13
13
  */
14
- import { type MarkupUrl } from './markup.js';
14
+ import { type MarkupUrl, type MarkupLevel, type StyleNote } from './markup.js';
15
15
  /** An address, optionally with a display name. */
16
16
  export interface Recipient {
17
17
  name?: string;
@@ -30,6 +30,20 @@ export interface Draft {
30
30
  references?: string[];
31
31
  /** Our own Message-ID. Minted here so there is a handle straight away. */
32
32
  messageId: string;
33
+ /**
34
+ * How much markup this message may carry. Absent means `standard`.
35
+ *
36
+ * Part of the draft rather than a parameter beside it, because it decides
37
+ * what the message is allowed to contain.
38
+ *
39
+ * Note what the digest does and does not bind: it covers `html` as source
40
+ * text, so the markup itself cannot be swapped after the answer, but it does
41
+ * not carry the level. That holds today only because a wider level merely
42
+ * permits more of the same string. Anything that makes the level change what
43
+ * goes out, rather than what is allowed in, has to be added to `digestOf`
44
+ * first.
45
+ */
46
+ markupLevel?: MarkupLevel;
33
47
  /** A whole message carried along, used when forwarding. */
34
48
  attachedMessage?: {
35
49
  filename: string;
@@ -123,29 +137,15 @@ export declare function quote(original: {
123
137
  subject: string;
124
138
  text: string;
125
139
  }, limit?: number): string;
126
- /** Turns text into markup that says exactly what the text said. */
127
- export declare function escapeHtml(text: string): string;
128
140
  /**
129
- * Quotes a message inside a formatted reply.
130
- *
131
- * **The quote is built from the original's text, never from its markup**, and
132
- * that is the whole design rather than a shortcut. Two reasons, and the second
133
- * is the one that matters:
141
+ * Turns text into markup that says exactly what the text said.
134
142
  *
135
- * 1. Carrying the original's markup would mean checking a stranger's HTML
136
- * against the permitted set and refusing the reply when it fails. Ordinary
137
- * mail is full of `<style>` blocks, so replying to real messages would
138
- * mostly not work.
139
- * 2. It would put markup written by somebody else into a message sent under
140
- * this account's name. A link in the quote could show one thing and go
141
- * somewhere else, and it would ride along into the reply without anybody
142
- * having written it.
143
- *
144
- * The text comes from the same conversion this server uses to read a message,
145
- * so a link in the original appears as its address in the quote. A phishing
146
- * mail quoted in a reply arrives with its targets in plain sight. It is then
147
- * escaped, because text that happens to contain angle brackets must stay text.
143
+ * For element content. It does not escape the apostrophe, so it is not safe for
144
+ * a single-quoted attribute value; every caller here puts the result between
145
+ * tags. The interface has its own escapeHtml which does cover it, for markup it
146
+ * builds with attributes.
148
147
  */
148
+ export declare function escapeHtml(text: string): string;
149
149
  /**
150
150
  * The quoted body alone, without the "wrote:" line.
151
151
  *
@@ -211,6 +211,16 @@ export declare const UTF8_NOTE: string;
211
211
  * alternative is an invitation to try anyway.
212
212
  */
213
213
  export declare const MARKUP_NOTE: string;
214
+ /**
215
+ * What a caller is told about the two levels.
216
+ *
217
+ * Written to be read by something that will otherwise reach for the wider one
218
+ * out of convenience. The cost is stated in terms of what the user sees,
219
+ * because that is the part a model can reason about: at `extended` the person
220
+ * being asked gets a warning telling them to go and look, every time, whether
221
+ * or not anything was actually hidden.
222
+ */
223
+ export declare const MARKUP_LEVEL_NOTE: string;
214
224
  export declare const PLAIN_TEXT_NOTE: string;
215
225
  /**
216
226
  * The message as a person will read it.
@@ -246,14 +256,21 @@ export interface QuoteSummary {
246
256
  * message on average and up to thirty links. Listing those would bury the two
247
257
  * addresses that matter under thirty that arrived in the sender's mailbox
248
258
  * anyway, and a confirmation nobody reads to the end protects nobody.
259
+ *
260
+ * Worth knowing about the trade: because the quote keeps the original's markup,
261
+ * a link in it shows its text and hides its target, the same as in the message
262
+ * that arrived. An earlier version quoted as text, where every target was
263
+ * spelled out. What replaces that is the rendered preview page, where the quote
264
+ * is visible as the recipient will see it.
249
265
  */
250
266
  export declare function summariseQuote(draft: Draft): QuoteSummary | undefined;
251
267
  /**
252
268
  * Everything the message points at or carries, for the confirmation.
253
269
  *
254
- * Kept whole and never shortened. The body excerpt in a confirmation is cut
255
- * after a few lines, so an address on line thirty would otherwise never be
256
- * shown, which is precisely where one would be put to avoid being read.
270
+ * Kept whole and never shortened. The confirmation carries counts and the
271
+ * preview page carries the detail, so this is the list a person reads before
272
+ * answering. Shortening it would hide the entry on line thirty, which is
273
+ * precisely where one would be put to avoid being read.
257
274
  */
258
275
  export declare function describeAttachments(draft: Draft): string[];
259
276
  /** The addresses in a message's markup, with the text they are shown as. */
@@ -262,3 +279,12 @@ export declare function describeUrls(draft: Draft): MarkupUrl[];
262
279
  export declare function hiddenTextOf(draft: Draft): string[];
263
280
  /** A fingerprint of a file, so a confirmation can be bound to its contents. */
264
281
  export declare function fingerprintPart(content: Buffer): string;
282
+ /**
283
+ * The properties this message uses that are worth mentioning before it is sent.
284
+ *
285
+ * Empty at markup level `standard`, because nothing outside the ordinary set
286
+ * gets that far. At `extended` it is what the confirmation warns about and the
287
+ * preview lists, and it is the reason the level is worth having: the answer to
288
+ * "what did it use" is a list rather than a promise.
289
+ */
290
+ export declare function styleNotesOf(draft: Draft): StyleNote[];
@@ -14,7 +14,7 @@
14
14
  import MailComposer from 'nodemailer/lib/mail-composer/index.js';
15
15
  import { createHash, randomUUID } from 'node:crypto';
16
16
  import { BridgeError } from '../bridge/errors.js';
17
- import { assertSendableMarkup, readMarkup } from './markup.js';
17
+ import { assertSendableMarkup, readMarkup, } from './markup.js';
18
18
  import { prepareQuotedMarkup } from './quote.js';
19
19
  import { htmlToText } from '../mime/parse.js';
20
20
  /**
@@ -99,7 +99,7 @@ export async function buildMessage(draft, options = {}) {
99
99
  else {
100
100
  // Checked here rather than only at the tool, so that no path into this
101
101
  // function can produce a message whose markup was never read.
102
- const reading = assertSendableMarkup(draft.html);
102
+ const reading = assertSendableMarkup(draft.html, draft.markupLevel ?? 'standard');
103
103
  // Every content id the markup points at has to have arrived with it. A
104
104
  // reference to a part that is not there shows the recipient a broken image
105
105
  // where the sender saw a picture, and neither of them finds out why.
@@ -188,7 +188,14 @@ function quoteHeader(original) {
188
188
  : 'an unknown date';
189
189
  return `On ${escapeHtml(when)}, ${escapeHtml(who)} wrote:`;
190
190
  }
191
- /** Turns text into markup that says exactly what the text said. */
191
+ /**
192
+ * Turns text into markup that says exactly what the text said.
193
+ *
194
+ * For element content. It does not escape the apostrophe, so it is not safe for
195
+ * a single-quoted attribute value; every caller here puts the result between
196
+ * tags. The interface has its own escapeHtml which does cover it, for markup it
197
+ * builds with attributes.
198
+ */
192
199
  export function escapeHtml(text) {
193
200
  return text
194
201
  .replace(/&/g, '&amp;')
@@ -196,27 +203,6 @@ export function escapeHtml(text) {
196
203
  .replace(/>/g, '&gt;')
197
204
  .replace(/"/g, '&quot;');
198
205
  }
199
- /**
200
- * Quotes a message inside a formatted reply.
201
- *
202
- * **The quote is built from the original's text, never from its markup**, and
203
- * that is the whole design rather than a shortcut. Two reasons, and the second
204
- * is the one that matters:
205
- *
206
- * 1. Carrying the original's markup would mean checking a stranger's HTML
207
- * against the permitted set and refusing the reply when it fails. Ordinary
208
- * mail is full of `<style>` blocks, so replying to real messages would
209
- * mostly not work.
210
- * 2. It would put markup written by somebody else into a message sent under
211
- * this account's name. A link in the quote could show one thing and go
212
- * somewhere else, and it would ride along into the reply without anybody
213
- * having written it.
214
- *
215
- * The text comes from the same conversion this server uses to read a message,
216
- * so a link in the original appears as its address in the quote. A phishing
217
- * mail quoted in a reply arrives with its targets in plain sight. It is then
218
- * escaped, because text that happens to contain angle brackets must stay text.
219
- */
220
206
  /**
221
207
  * The quoted body alone, without the "wrote:" line.
222
208
  *
@@ -313,8 +299,29 @@ export const MARKUP_NOTE = 'A message may instead be written as markup, in the h
313
299
  'arrive. Permitted are headings, paragraphs, line breaks, rules, quotes, emphasis, lists, ' +
314
300
  'tables, links and images, with colour, font, alignment, spacing and borders. Anything else ' +
315
301
  'is refused rather than quietly removed, and the answer names what and why. Note that the ' +
316
- 'confirmation shows every address in the message in full, including the ones behind links and ' +
317
- 'images, and every alt text, because those are what a recipient reads.';
302
+ 'preview page linked from the confirmation lists every address in the message in full, ' +
303
+ 'including the ones behind links and images, and every alt text, because those are what a ' +
304
+ 'recipient reads. The question in the client stays short and carries counts instead.';
305
+ /**
306
+ * What a caller is told about the two levels.
307
+ *
308
+ * Written to be read by something that will otherwise reach for the wider one
309
+ * out of convenience. The cost is stated in terms of what the user sees,
310
+ * because that is the part a model can reason about: at `extended` the person
311
+ * being asked gets a warning telling them to go and look, every time, whether
312
+ * or not anything was actually hidden.
313
+ */
314
+ export const MARKUP_LEVEL_NOTE = 'The markupLevel field decides how much is permitted. "standard" is the default and covers ' +
315
+ 'ordinary formatted mail: colour, background, font, alignment, spacing, borders and size. ' +
316
+ '"extended" permits every CSS property, including ones that can put content out of sight such ' +
317
+ 'as display, visibility, opacity and position. **Prefer "standard".** At "extended" the ' +
318
+ 'confirmation carries a prominent warning telling the person to open the preview before ' +
319
+ 'answering, and the preview lists every property used, its value and the element it sat on. ' +
320
+ 'That warning appears whether or not anything was really hidden, so reaching for "extended" ' +
321
+ 'without needing it makes every send noisier and trains people to click past a warning that ' +
322
+ 'matters. Use it when the user asked for something that needs it, or when there is genuinely ' +
323
+ 'no other way, and say which of the two it was. One common case: a link cannot fill its own ' +
324
+ 'padding without display:inline-block, so a proper button needs "extended".';
318
325
  export const PLAIN_TEXT_NOTE = 'The body is plain text and markup is not interpreted. HTML written here is delivered as ' +
319
326
  'visible characters, so the recipient would read the tags rather than see formatting. ' +
320
327
  'Give a message its shape with line breaks, blank lines, indentation and plain lists, and ' +
@@ -352,6 +359,12 @@ export function composedBody(draft) {
352
359
  * message on average and up to thirty links. Listing those would bury the two
353
360
  * addresses that matter under thirty that arrived in the sender's mailbox
354
361
  * anyway, and a confirmation nobody reads to the end protects nobody.
362
+ *
363
+ * Worth knowing about the trade: because the quote keeps the original's markup,
364
+ * a link in it shows its text and hides its target, the same as in the message
365
+ * that arrived. An earlier version quoted as text, where every target was
366
+ * spelled out. What replaces that is the rendered preview page, where the quote
367
+ * is visible as the recipient will see it.
355
368
  */
356
369
  export function summariseQuote(draft) {
357
370
  if (!draft.quotedHtml)
@@ -366,9 +379,10 @@ export function summariseQuote(draft) {
366
379
  /**
367
380
  * Everything the message points at or carries, for the confirmation.
368
381
  *
369
- * Kept whole and never shortened. The body excerpt in a confirmation is cut
370
- * after a few lines, so an address on line thirty would otherwise never be
371
- * shown, which is precisely where one would be put to avoid being read.
382
+ * Kept whole and never shortened. The confirmation carries counts and the
383
+ * preview page carries the detail, so this is the list a person reads before
384
+ * answering. Shortening it would hide the entry on line thirty, which is
385
+ * precisely where one would be put to avoid being read.
372
386
  */
373
387
  export function describeAttachments(draft) {
374
388
  const lines = [];
@@ -382,14 +396,31 @@ export function describeAttachments(draft) {
382
396
  }
383
397
  /** The addresses in a message's markup, with the text they are shown as. */
384
398
  export function describeUrls(draft) {
385
- return draft.html === undefined ? [] : assertSendableMarkup(draft.html).urls;
399
+ return draft.html === undefined
400
+ ? []
401
+ : assertSendableMarkup(draft.html, draft.markupLevel ?? 'standard').urls;
386
402
  }
387
403
  /** Text a recipient can read that the readable body leaves out. */
388
404
  export function hiddenTextOf(draft) {
389
- return draft.html === undefined ? [] : assertSendableMarkup(draft.html).hiddenText;
405
+ return draft.html === undefined
406
+ ? []
407
+ : assertSendableMarkup(draft.html, draft.markupLevel ?? 'standard').hiddenText;
390
408
  }
391
409
  /** A fingerprint of a file, so a confirmation can be bound to its contents. */
392
410
  export function fingerprintPart(content) {
393
411
  return createHash('sha256').update(content).digest('hex').slice(0, 16);
394
412
  }
413
+ /**
414
+ * The properties this message uses that are worth mentioning before it is sent.
415
+ *
416
+ * Empty at markup level `standard`, because nothing outside the ordinary set
417
+ * gets that far. At `extended` it is what the confirmation warns about and the
418
+ * preview lists, and it is the reason the level is worth having: the answer to
419
+ * "what did it use" is a list rather than a promise.
420
+ */
421
+ export function styleNotesOf(draft) {
422
+ if (draft.html === undefined)
423
+ return [];
424
+ return assertSendableMarkup(draft.html, draft.markupLevel ?? 'standard').styleNotes;
425
+ }
395
426
  //# sourceMappingURL=compose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/mail/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,YAAY,MAAM,uCAAuC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AA8D7C;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACxB,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,WAAW,CAAC,oCAAoC,CAAC,CAAA;IACrE,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,WAAW,CACnB,kBAAkB,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,8CAA8C;YAC1F,gFAAgF,CACnF,CAAA;IACH,CAAC;IAED,MAAM,M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11 @@ export interface ResolvedMessage {
42
42
  path: string;
43
43
  /** Valid only together with `path`, and only until the message is moved. */
44
44
  uid: number;
45
- /** Changes when the Bridge renumbers UIDs. Cached UIDs are void afterwards. */
45
+ /**
46
+ * Changes when the Bridge renumbers a mailbox, which invalidates every UID in
47
+ * it. Reported for diagnosis only: nothing here keeps a UID beyond the call
48
+ * that resolved it, so there is no cache for this to invalidate.
49
+ */
46
50
  uidValidity: string;
47
51
  }
48
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/mail/ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,mFAAmF;AACnF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA;AAElC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC3C,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,EAAE,CAAA;IACzB,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,WAAW,CAAC,yCAAyC,CAAC,CAAA;IAC9E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC1C,OAAO,IAAI,IAAI,GAAG,CAAA;AACpB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAC1B,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnD,CAAC;AAYD,4EAA4E;AAC5E,SAAS,QAAQ,CAAC,SAAiB;IACjC,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACxC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,SAAS,CAAC,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GS: Set<string>;
52
52
  /** Style properties a message may set. */
53
53
  export declare const PERMITTED_STYLES: Set<string>;
54
+ /**
55
+ * Properties that can take content out of sight without taking it out of the
56
+ * message.
57
+ *
58
+ * These used to be refused outright. That was too blunt in both directions.
59
+ * `display: inline-block` is what makes a link fill its own padding, which is
60
+ * what makes a button clickable, and it hides nothing; `float` is ordinary
61
+ * layout that mail has used for twenty years. Refusing the property rather than
62
+ * the value cost every message a usable button and bought nothing, because a
63
+ * confirmation that reads markup without applying it showed the hidden text
64
+ * anyway.
65
+ *
66
+ * What changed is that the preview now renders. Text hidden by CSS really does
67
+ * disappear from it, so the answer is no longer to refuse the property but to
68
+ * say plainly that it was used, where, and how often, and to let the person
69
+ * decide.
70
+ */
71
+ export declare const RISKY_STYLES: Set<string>;
54
72
  /** One reason a message was refused. */
55
73
  export interface MarkupProblem {
56
74
  /** What was found, in the caller's own markup. */
@@ -58,11 +76,47 @@ export interface MarkupProblem {
58
76
  /** Why it cannot be sent, and what to do instead. */
59
77
  reason: string;
60
78
  }
79
+ /**
80
+ * How much markup a message may carry.
81
+ *
82
+ * Chosen per call by whoever is composing, with `standard` as the default that
83
+ * applies when nobody says otherwise. The point of naming them rather than
84
+ * listing properties is that a caller has to decide something it can explain,
85
+ * and that the answer travels into the confirmation where a person sees it.
86
+ */
87
+ export type MarkupLevel =
88
+ /**
89
+ * Colour, font, spacing, borders, size, alignment. Everything an ordinary
90
+ * formatted message uses, and nothing that can put text out of sight.
91
+ * Anything else is refused with a reason.
92
+ */
93
+ 'standard'
94
+ /**
95
+ * Every CSS property, including the ones that can hide content. Nothing is
96
+ * refused for being a style; what is used is reported instead, and the
97
+ * confirmation says so in as many words.
98
+ */
99
+ | 'extended';
100
+ /** One use of a property worth telling the person about before they agree. */
101
+ export interface StyleNote {
102
+ property: string;
103
+ value: string;
104
+ /** The element it sat on, so the preview can say where. */
105
+ element: string;
106
+ /** True when this value really does take something out of sight. */
107
+ hides: boolean;
108
+ }
61
109
  /** An address the message points at, which a person has to see before sending. */
62
110
  export interface MarkupUrl {
63
- kind: 'link' | 'image';
111
+ /**
112
+ * `style` is an address inside a CSS value, such as `background: url(...)`.
113
+ * It is its own kind because a reader has no text for it and no way to see it
114
+ * coming: a link shows words, an image shows a frame or its alt text, and a
115
+ * CSS background shows nothing at all while still being fetched.
116
+ */
117
+ kind: 'link' | 'image' | 'style';
64
118
  url: string;
65
- /** The text a reader sees for a link, or the alt text of an image. */
119
+ /** The text a reader sees for a link, the alt text of an image, or the property and element for a CSS address. */
66
120
  label: string;
67
121
  }
68
122
  export interface MarkupReading {
@@ -72,6 +126,14 @@ export interface MarkupReading {
72
126
  hiddenText: string[];
73
127
  /** Content ids an image refers to, which have to be provided as parts. */
74
128
  contentIds: string[];
129
+ /**
130
+ * Properties used that are worth telling the person about.
131
+ *
132
+ * Empty for a message that stays inside the ordinary set, which is almost
133
+ * every message. Anything in here means the confirmation says so and the
134
+ * preview lists it.
135
+ */
136
+ styleNotes: StyleNote[];
75
137
  }
76
138
  /**
77
139
  * Reads a message's markup: what is wrong with it, and what has to be shown.
@@ -79,7 +141,7 @@ export interface MarkupReading {
79
141
  * One pass, because the two questions are the same walk over the document and
80
142
  * answering them separately is how they drift apart.
81
143
  */
82
- export declare function readMarkup(html: string): MarkupReading;
144
+ export declare function readMarkup(html: string, level?: MarkupLevel): MarkupReading;
83
145
  /**
84
146
  * Refuses markup this server will not send.
85
147
  *
@@ -88,4 +150,4 @@ export declare function readMarkup(html: string): MarkupReading;
88
150
  * nobody would find out: not the caller, whose formatting quietly vanishes, and
89
151
  * not the person confirming, who has nothing to compare against.
90
152
  */
91
- export declare function assertSendableMarkup(html: string): MarkupReading;
153
+ export declare function assertSendableMarkup(html: string, level?: MarkupLevel): MarkupReading;