domma-cms 1.71.1 → 1.73.0

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 (87) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/docs/DommaFeatures.md +1 -0
  3. package/package.json +1 -1
  4. package/plugins/_lib/admin/mail/body-menu.js +1 -1
  5. package/plugins/_lib/admin/mail/cms-host.js +1 -1
  6. package/plugins/_lib/admin/mail/compose-window.js +90 -3
  7. package/plugins/_lib/admin/mail/contacts.js +1 -1
  8. package/plugins/_lib/admin/mail/diagnostics-section.js +75 -41
  9. package/plugins/_lib/admin/mail/drag-drop.js +1 -1
  10. package/plugins/_lib/admin/mail/folder-tree.js +1 -1
  11. package/plugins/_lib/admin/mail/font-controls.js +1 -1
  12. package/plugins/_lib/admin/mail/fonts.js +1 -1
  13. package/plugins/_lib/admin/mail/host-context.js +1 -1
  14. package/plugins/_lib/admin/mail/identity.js +1 -1
  15. package/plugins/_lib/admin/mail/image-senders-section.js +156 -99
  16. package/plugins/_lib/admin/mail/keyboard.js +1 -1
  17. package/plugins/_lib/admin/mail/mail.css +1 -1
  18. package/plugins/_lib/admin/mail/mail.html +1 -1
  19. package/plugins/_lib/admin/mail/message-actions.js +1 -1
  20. package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
  21. package/plugins/_lib/admin/mail/panes.js +1 -1
  22. package/plugins/_lib/admin/mail/reader-kit.js +12 -4
  23. package/plugins/_lib/admin/mail/reader-runtime.js +372 -96
  24. package/plugins/_lib/admin/mail/reader-view.js +1 -1
  25. package/plugins/_lib/admin/mail/resizable.js +1 -1
  26. package/plugins/_lib/admin/mail/restore-spam.js +1 -1
  27. package/plugins/_lib/admin/mail/rules.js +1 -1
  28. package/plugins/_lib/admin/mail/scheduling.js +1 -1
  29. package/plugins/_lib/admin/mail/section-kit.js +1 -1
  30. package/plugins/_lib/admin/mail/security-note.js +1 -1
  31. package/plugins/_lib/admin/mail/settings-section.js +156 -99
  32. package/plugins/_lib/admin/mail/templates.js +1 -1
  33. package/plugins/_lib/admin/mail/threads.js +1 -1
  34. package/plugins/_lib/admin/mail/vacation.js +45 -1
  35. package/plugins/_lib/admin/mail/when-closed.js +1 -1
  36. package/plugins/_lib/admin/ui/dates.js +1 -1
  37. package/plugins/_lib/admin/ui/resizable.js +1 -1
  38. package/plugins/_lib/admin/ui/rich-field.js +291 -0
  39. package/plugins/_lib/domma-mail.lock.json +83 -80
  40. package/plugins/_lib/mail/accountFileStore.js +1 -1
  41. package/plugins/_lib/mail/accountRepository.js +31 -3
  42. package/plugins/_lib/mail/accountRoutes.js +1 -1
  43. package/plugins/_lib/mail/accounts.js +1 -1
  44. package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
  45. package/plugins/_lib/mail/bodyTokens.js +1 -1
  46. package/plugins/_lib/mail/compose.js +1 -1
  47. package/plugins/_lib/mail/defaults.js +1 -1
  48. package/plugins/_lib/mail/envelope.js +1 -1
  49. package/plugins/_lib/mail/folderActions.js +1 -1
  50. package/plugins/_lib/mail/folderRuntime.js +1 -1
  51. package/plugins/_lib/mail/folders.js +1 -1
  52. package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
  53. package/plugins/_lib/mail/mbox.js +1 -1
  54. package/plugins/_lib/mail/message-action.js +1 -1
  55. package/plugins/_lib/mail/messageSecurity.js +1 -1
  56. package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
  57. package/plugins/_lib/mail/networkAddresses.js +1 -1
  58. package/plugins/_lib/mail/networkPolicy.js +1 -1
  59. package/plugins/_lib/mail/oauthAccounts.js +1 -1
  60. package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
  61. package/plugins/_lib/mail/oauthRuntime.js +1 -1
  62. package/plugins/_lib/mail/pollSchedule.js +1 -1
  63. package/plugins/_lib/mail/poller.js +1 -1
  64. package/plugins/_lib/mail/pollerRuntime.js +1 -1
  65. package/plugins/_lib/mail/priority.js +1 -1
  66. package/plugins/_lib/mail/publicMailbox.js +1 -1
  67. package/plugins/_lib/mail/readRuntime.js +1 -1
  68. package/plugins/_lib/mail/render.js +1 -1
  69. package/plugins/_lib/mail/ruleRunner.js +1 -1
  70. package/plugins/_lib/mail/schedulerRuntime.js +1 -1
  71. package/plugins/_lib/mail/secretProvider.js +1 -1
  72. package/plugins/_lib/mail/secretbox.js +1 -1
  73. package/plugins/_lib/mail/senderAuth.js +1 -1
  74. package/plugins/_lib/mail/sieve.js +1 -1
  75. package/plugins/_lib/mail/smtpService.js +1 -1
  76. package/plugins/_lib/mail/snoozeRuntime.js +1 -1
  77. package/plugins/_lib/mail/store.js +1 -1
  78. package/plugins/_lib/mail/subscriptions.js +1 -1
  79. package/plugins/_lib/mail/syncPlan.js +1 -1
  80. package/plugins/_lib/mail/syncRuntime.js +1 -1
  81. package/plugins/_lib/mail/syncSelection.js +1 -1
  82. package/plugins/_lib/mail/unreadBadge.js +1 -1
  83. package/plugins/_lib/mail/unsubscribe.js +1 -1
  84. package/plugins/_lib/mail/vacationRuntime.js +1 -1
  85. package/plugins/_lib/mail/write.js +1 -1
  86. package/plugins/_lib/public/rich-text.mjs +104 -0
  87. package/plugins/_lib/rich-text.js +153 -0
@@ -0,0 +1,291 @@
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/admin/ui/rich-field.js.
2
+ // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
+ /**
4
+ * A Description field as a rich text editor, and a description shown in the admin.
5
+ *
6
+ * ## One line to adopt
7
+ *
8
+ * `richDescription(textarea)` puts Domma's rich editor in the textarea's place
9
+ * and keeps the textarea (hidden) as the field: its `.value` is the editor's
10
+ * HTML, reading it or setting it works as before, and it fires `input` and
11
+ * `change` as the editor changes. So a view that reads `$('#x').val()`, a
12
+ * `data-model` binding and a draft keeper all carry on unchanged.
13
+ *
14
+ * What is stored is described in `/public/js/rich-text.mjs`: text typed before
15
+ * the field was rich is shown in the editor as paragraphs and is only rewritten
16
+ * as HTML once somebody edits it. An editor left empty gives `''`. The server
17
+ * cleans whatever arrives (`server/services/richText.js`); nothing here is the
18
+ * safety.
19
+ *
20
+ * Without Domma's editor the textarea is simply left as it is.
21
+ *
22
+ * ## In a dense screen
23
+ *
24
+ * `richDescription(textarea, {compact: true})` is the same field at the height
25
+ * of a line or two: its toolbar shows only while the editor has the focus and
26
+ * the word count is left out. For a caption inside a row of other inputs. The
27
+ * toolbar opens UNDER the text, so the line being clicked does not move away
28
+ * from the pointer between the press and the release.
29
+ *
30
+ * @module admin/js/lib/rich-field
31
+ */
32
+ import {isRichText, plainToRichHtml, richTextToPlain, richTextSummary, richTextLine, escapeHtml} from '../../public/rich-text.mjs';
33
+
34
+ export {isRichText, richTextToPlain, richTextSummary, richTextLine};
35
+
36
+ /** The CMS field, using the editor and sanitizer supplied by its host. */
37
+ export function createRichFields(services = globalThis) {
38
+
39
+
40
+ /** Formatting a description can have. No images, embeds or code blocks. */
41
+ const TOOLBAR = [['bold', 'italic', 'underline'], ['ul', 'ol'], ['link'], ['undo', 'redo']];
42
+
43
+ /** What the admin will draw from a rich description (the server allows the same). */
44
+ const SHOWN = {
45
+ ALLOWED_TAGS: ['p', 'br', 'strong', 'b', 'em', 'i', 'u', 's', 'ul', 'ol', 'li', 'a', 'h2', 'h3', 'h4', 'blockquote', 'code'],
46
+ ALLOWED_ATTR: ['href', 'target', 'rel'],
47
+ ALLOW_DATA_ATTR: false
48
+ };
49
+
50
+ /** Tokens only, so both follow every theme. Added to the page once. */
51
+ const CSS_ID = 'rich-description-css';
52
+ const STYLES = `
53
+ .rich-description{display:none}
54
+ .rich-description-editor .dm-editor-body,.rich-description-editor .dm-editor-content{min-height:var(--rich-description-min,6rem)}
55
+ .rich-description-editor .dm-editor-content{padding:.6rem .75rem}
56
+ .rich-description-compact .dm-editor-toolbar,.rich-description-compact .dm-editor-footer{display:none}
57
+ .rich-description-compact:focus-within .dm-editor-toolbar{display:flex}
58
+ .rich-description-compact .dm-editor-content{padding:.4rem .6rem;font-size:var(--dm-font-size-sm)}
59
+ .rich-description-compact .dm-editor-content>:first-child{margin-top:0}
60
+ .rich-description-compact .dm-editor-content>:last-child{margin-bottom:0}
61
+ .rich-description-compact .dm-editor-toolbar{order:2;border-bottom:0;border-top:1px solid var(--dm-border);padding:.25rem .4rem;gap:.25rem}
62
+ .rich-description-compact .dm-editor-toolbar-btn{width:26px;height:26px}
63
+ .rich-text>:first-child{margin-top:0}
64
+ .rich-text>:last-child{margin-bottom:0}
65
+ .rich-text p,.rich-text ul,.rich-text ol,.rich-text blockquote{margin:0 0 .5em}
66
+ .rich-text ul,.rich-text ol{padding-left:1.25em}
67
+ `;
68
+ function styles() {
69
+ if (document.getElementById(CSS_ID)) return;
70
+ const style = document.createElement('style');
71
+ style.id = CSS_ID;
72
+ style.textContent = STYLES;
73
+ document.head.appendChild(style);
74
+ }
75
+
76
+ const NATIVE = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
77
+
78
+ /** The editor's markup for a stored value. */
79
+ const toEditor = value => (isRichText(value) ? value : plainToRichHtml(value));
80
+
81
+ const BLOCKS = /^(P|UL|OL|H[1-6]|BLOCKQUOTE|DIV)$/;
82
+
83
+ /**
84
+ * The editor's markup with every line inside a block element. Typed into an
85
+ * empty editor, the browser leaves the first line bare and makes the next ones
86
+ * divs ("first<div>second</div>"); stored like that, the value would not start
87
+ * with a block element and so would be taken for plain text and shown with its
88
+ * tags. Bare runs become paragraphs and divs become paragraphs.
89
+ *
90
+ * @param {string} html - as the editor gives it
91
+ * @returns {string}
92
+ */
93
+ function asBlocks(html) {
94
+ const doc = new DOMParser().parseFromString(`<body>${html ?? ''}</body>`, 'text/html');
95
+ const out = doc.createElement('div');
96
+ let run = null;
97
+ for (const node of [...doc.body.childNodes]) {
98
+ if (node.nodeType === 1 && BLOCKS.test(node.tagName)) {
99
+ run = null;
100
+ if (node.tagName === 'DIV') {
101
+ const p = doc.createElement('p');
102
+ p.append(...node.childNodes);
103
+ out.append(p);
104
+ } else out.append(node);
105
+ continue;
106
+ }
107
+ // White space between blocks is not a line of its own.
108
+ if (!run && node.nodeType === 3 && !node.textContent.trim()) continue;
109
+ if (!run) { run = doc.createElement('p'); out.append(run); }
110
+ run.append(node);
111
+ }
112
+ return out.innerHTML;
113
+ }
114
+
115
+ /** Does this markup say anything? An empty list item reads as its bullet alone. */
116
+ const saysSomething = html => Boolean(richTextToPlain(toEditor(html)).replace(/^- ?$/gm, '').trim());
117
+
118
+ /**
119
+ * Turn a Description textarea into a rich text editor.
120
+ *
121
+ * @param {HTMLTextAreaElement|string|object} target - the textarea, a selector, or a Domma collection
122
+ * @param {{minHeight?: number, placeholder?: string, compact?: boolean}} [options] - `compact`: a line or
123
+ * two tall (minHeight 40 unless given), the toolbar shown only while the editor has the focus
124
+ * @returns {{rich: boolean, get: () => string, getText: () => string, set: (value: string) => void,
125
+ * focus: () => void, destroy: () => void}}
126
+ */
127
+ function richDescription(target, {compact = false, minHeight = compact ? 40 : 88, placeholder} = {}) {
128
+ const area = typeof target === 'string' ? document.querySelector(target) : (target?.get?.(0) ?? target);
129
+ const plain = {
130
+ rich: false,
131
+ get: () => area?.value ?? '',
132
+ getText: () => richTextToPlain(area?.value ?? ''),
133
+ set: value => { if (area) area.value = value ?? ''; },
134
+ focus: () => area?.focus(),
135
+ destroy: () => {}
136
+ };
137
+ if (!(area instanceof HTMLTextAreaElement) || area._richDescription || typeof services.E?.editor !== 'function') {
138
+ return area?._richDescription ?? plain;
139
+ }
140
+
141
+ const host = document.createElement('div');
142
+ host.className = 'rich-description';
143
+ area.after(host);
144
+ let editor;
145
+ /** True while the editor is being filled, so that is not taken for typing. */
146
+ let filling = false;
147
+ /** What the editor was last filled with or said: never refill it with its own words. */
148
+ let shown = null;
149
+
150
+ const store = (value) => {
151
+ if (NATIVE.get.call(area) === value) return;
152
+ NATIVE.set.call(area, value);
153
+ area.dispatchEvent(new Event('input', {bubbles: true}));
154
+ area.dispatchEvent(new Event('change', {bubbles: true}));
155
+ };
156
+ const fill = (value) => {
157
+ const html = toEditor(value);
158
+ if (html === shown) return;
159
+ filling = true;
160
+ try { editor.setValue(html); } finally { filling = false; }
161
+ shown = html;
162
+ };
163
+
164
+ try {
165
+ editor = services.E.editor(host, {
166
+ mode: 'rich', minHeight, imagePaste: false, toolbar: TOOLBAR,
167
+ placeholder: placeholder ?? area.getAttribute('placeholder') ?? '',
168
+ onChange: (html) => {
169
+ if (filling) return;
170
+ const raw = typeof html === 'string' ? html : editor.getValue();
171
+ const value = saysSomething(raw) ? asBlocks(raw) : '';
172
+ // Remembered as it is stored (as blocks): a bound field hands the stored
173
+ // value straight back, and that must not refill the editor mid-typing.
174
+ shown = value || raw;
175
+ store(value);
176
+ }
177
+ });
178
+ } catch {
179
+ host.remove();
180
+ return plain;
181
+ }
182
+
183
+ // Domma builds the editor beside the element it was given, not inside it.
184
+ const frame = host.nextElementSibling?.querySelector('[contenteditable]') ? host.nextElementSibling : host;
185
+ styles();
186
+ frame.classList.add('rich-description-editor');
187
+ if (compact) frame.classList.add('rich-description-compact');
188
+ frame.style.minHeight = '';
189
+ frame.style.setProperty('--rich-description-min', `${minHeight}px`);
190
+ // The label names the editor now; the textarea's length limit was for
191
+ // plain text and would count markup (the server keeps its own).
192
+ const editable = frame.querySelector('[contenteditable]');
193
+ // Inside a <label>, a click on the text would be passed to the label's first
194
+ // control - a help button, usually - and take the focus out of the editor.
195
+ frame.addEventListener('click', (e) => {
196
+ if (frame.closest('label') && !e.target.closest('button, a, input, select, textarea')) e.preventDefault();
197
+ });
198
+ const label = area.id ? document.querySelector(`label[for="${CSS.escape(area.id)}"]`) : area.closest('label');
199
+ const named = area.getAttribute('aria-label') || label?.childNodes[0]?.textContent?.trim() || 'Description';
200
+ editable?.setAttribute('aria-label', named);
201
+ area.removeAttribute('maxlength');
202
+ area.hidden = true;
203
+
204
+ fill(NATIVE.get.call(area));
205
+ Object.defineProperty(area, 'value', {
206
+ configurable: true,
207
+ get: () => NATIVE.get.call(area),
208
+ set: (value) => {
209
+ NATIVE.set.call(area, value ?? '');
210
+ fill(NATIVE.get.call(area));
211
+ }
212
+ });
213
+
214
+ const handle = {
215
+ rich: true,
216
+ get: () => NATIVE.get.call(area),
217
+ getText: () => richTextToPlain(NATIVE.get.call(area)),
218
+ set: (value) => { area.value = value ?? ''; },
219
+ focus: () => editable?.focus(),
220
+ destroy: () => {
221
+ delete area.value;
222
+ delete area._richDescription;
223
+ try { editor.destroy?.(); } catch { /* gone with the view */ }
224
+ if (frame !== host) frame.remove();
225
+ host.remove();
226
+ area.hidden = false;
227
+ }
228
+ };
229
+ area._richDescription = handle;
230
+ return handle;
231
+ }
232
+
233
+ /**
234
+ * Show a stored description in an element: formatted when it is rich, as the
235
+ * text it is (line breaks kept) when it is plain.
236
+ *
237
+ * @param {Element|object} target - an element or a Domma collection
238
+ * @param {*} value - as stored
239
+ * @returns {void}
240
+ */
241
+ function showRichText(target, value) {
242
+ const el = target?.get?.(0) ?? target;
243
+ if (!el) return;
244
+ const text = typeof value === 'string' ? value : '';
245
+ if (!isRichText(text) || !services.DOMPurify) {
246
+ el.textContent = richTextToPlain(text);
247
+ el.style.whiteSpace = 'pre-line';
248
+ return;
249
+ }
250
+ el.style.whiteSpace = '';
251
+ styles();
252
+ const doc = new DOMParser().parseFromString(services.DOMPurify.sanitize(text, SHOWN), 'text/html');
253
+ for (const link of doc.body.querySelectorAll('a')) link.setAttribute('rel', 'noopener noreferrer');
254
+ el.classList.add('rich-text');
255
+ el.replaceChildren(...doc.body.childNodes);
256
+ }
257
+
258
+ /**
259
+ * A description as HTML for the inside of a line of text (a `<p>`, a caption):
260
+ * inline formatting only, a paragraph or list item becoming a line break. The
261
+ * admin's copy of the server's `renderRichTextPhrasing`, for a preview that
262
+ * draws what the public page will be given. Through DOMPurify; without it,
263
+ * the words alone, escaped.
264
+ *
265
+ * @param {*} value - as stored
266
+ * @param {{links?: boolean, legacyHtml?: boolean}} [options] - as the server's
267
+ * @returns {string}
268
+ */
269
+ function richTextInlineHtml(value, {links = true, legacyHtml = false} = {}) {
270
+ const text = typeof value === 'string' ? value.trim() : '';
271
+ if (!text) return '';
272
+ const rich = isRichText(text);
273
+ if (!services.DOMPurify || (!rich && !legacyHtml)) return escapeHtml(richTextLine(text));
274
+ const flat = text.replace(/<li(\s[^<>]*)?>/gi, '- ').replace(/<\/(p|h[1-6]|blockquote|li|ul|ol|div)>/gi, '<br>');
275
+ const html = services.DOMPurify.sanitize(flat, {
276
+ ALLOWED_TAGS: ['strong', 'b', 'em', 'i', 'u', 's', 'code', 'br', ...(links ? ['a'] : [])],
277
+ ALLOWED_ATTR: links ? ['href', 'target', 'rel'] : [],
278
+ ALLOW_DATA_ATTR: false
279
+ });
280
+ return html.replace(/(\s*<br\s*\/?>\s*){2,}/g, '<br>').replace(/^(\s|<br\s*\/?>)+|(\s|<br\s*\/?>)+$/g, '');
281
+ }
282
+
283
+ return {asBlocks, richDescription, showRichText, richTextInlineHtml};
284
+ }
285
+
286
+ let defaults;
287
+ const fields = () => defaults ??= createRichFields(globalThis);
288
+ export const asBlocks = (...args) => fields().asBlocks(...args);
289
+ export const richDescription = (...args) => fields().richDescription(...args);
290
+ export const showRichText = (...args) => fields().showRichText(...args);
291
+ export const richTextInlineHtml = (...args) => fields().richTextInlineHtml(...args);
@@ -1,86 +1,89 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@domma-mail/core",
4
- "version": "0.29.1",
4
+ "version": "0.32.0",
5
5
  "files": {
6
- "plugins/_lib/mail/defaults.js": "79e47820c6cf871377ce62aba2c06378adb643eecd4579a3cc9366ea5c8aaf07",
7
- "plugins/_lib/mail/priority.js": "0dbb92a647670ebfa0dc2d7b5a3880974eddf2dd1cb1e6d586d8cae1ea7c373f",
8
- "plugins/_lib/mail/envelope.js": "79fbe7f5ac34f7ea0ae76a667b4d2fecac076a7a19797de843e567330bc4cbba",
9
- "plugins/_lib/mail/pollSchedule.js": "7cc412753a730665db6cbd5a13be30ad468ff701a08903be5eae2b30a3248301",
10
- "plugins/_lib/mail/syncPlan.js": "7dec6c16cbe02bb1e8bbb2d4845b72c70e84a20b6f27669f474e9b9a951becb8",
11
- "plugins/_lib/admin/mail/threads.js": "a50fa45308b043d66e39a32b322d1245516f8feb2bb9397bfedc8e16369d35e6",
12
- "plugins/_lib/admin/mail/vacation.js": "69717be289cf856db5c78a6b0334fb8d25f5cfd264b64293cc9b10728492cc3b",
13
- "plugins/_lib/mail/secretProvider.js": "ce1d9475ac3d92726a8bfd7e9b17b3e02ac3ef27dfae58e1991d342ab0173924",
14
- "plugins/_lib/mail/secretbox.js": "be7d6db92e1679772b1494e7c7b8598da9974d707369c2c4ef5e512b3718e0b0",
15
- "plugins/_lib/mail/bodyTokenProvider.js": "62db6170fd49a5cdf374cd7f4c2ead1a9343fbb0b0cdf6d3215696a1a57ecb32",
16
- "plugins/_lib/mail/bodyTokens.js": "fa68e4304bc4fe291893166d29c330735d12c523006b4f41d430f401ebe978c3",
17
- "plugins/_lib/mail/accountFileStore.js": "16a3e02d8c5f2d608df8efdae6796e6a46ba68827d2fd321a31b9fca2f29a2b4",
18
- "plugins/_lib/mail/accountRepository.js": "df219f1b54f285f9c4a9cf0c48c8da931d35bd93b033ffa8f29e97efdc442c26",
19
- "plugins/_lib/mail/accountRoutes.js": "237e2991726f83fb21133fd012f2728e619b00ffbb60235d82c6cf9aa473f735",
20
- "plugins/_lib/mail/networkAddresses.js": "6ebd340bd4faa1d908c7a74694939da93f34bbaeddb81856fbb22e0ab99016e2",
21
- "plugins/_lib/mail/networkPolicy.js": "775749e7575033928fb9806ffc9fb864ddd27b73ad9c79352ff7ec2cc86aca92",
22
- "plugins/_lib/mail/imapPoolRuntime.js": "cb99cdc2a8b997b311c08c8cda187034112059adaad46d4bf2bcc007e5b4b62f",
23
- "plugins/_lib/mail/publicMailbox.js": "fe1dfda46fa5dbde5d7bd24b566bb62f01b80027282c23e6c174b73219d24379",
24
- "plugins/_lib/mail/render.js": "66e444d4e7a262cc34fc99537157c439bebf26a4ccb2b748fd574f9f692b057a",
25
- "plugins/_lib/mail/unsubscribe.js": "b3817ef604365de20f8f200a0bac243b84b2f97db87d2b3c9ad337d2a988d8df",
26
- "plugins/_lib/mail/unreadBadge.js": "7fe380cea0a6ac6fe177b47b6640641e448a21ad9f5d7cc486b044b3224e9113",
27
- "plugins/_lib/mail/message-action.js": "305358e8316f2b2e941d74084ee19274001451eb9f4b5af039d325d1a9ff58ec",
28
- "plugins/_lib/admin/mail/identity.js": "d8b01334d64031408c3236ca9895464d9cb430e96826fb4420a2110d3a95bd37",
29
- "plugins/_lib/mail/messageSecurityProvider.js": "08edb5188d101ab9814e20a8dd99ebe489b53ade6c372af72b8a8fa7edf8a94a",
30
- "plugins/_lib/mail/messageSecurity.js": "64010297e7eceb53aa399c5b19f5089ae20170c556f2feb5a7d9d3709a1fd2ea",
31
- "plugins/_lib/mail/smtpService.js": "1045f2353e7b825956ce480e3793b2fc29762de98930d3b2c738eef4f8305d65",
32
- "plugins/_lib/mail/subscriptions.js": "59ba271405ef3d300ea8471064ff4992bb904756b09494ae5a74dc1408c812dd",
33
- "plugins/_lib/mail/senderAuth.js": "686fe0779221df454f46496d26a54fff18c245ba4413a73ef8a54274af1b0d30",
34
- "plugins/_lib/mail/readRuntime.js": "ace0e7f2c9b162de5271b70b475ff2c43168619f0e4b64b36669f3fd5af92b10",
35
- "plugins/_lib/admin/mail/image-senders-section.js": "6b6d2ff0ad8ed562017256813329cf91f6d9494d69441c48e3077caf2dacd99b",
36
- "plugins/_lib/admin/mail/mail.html": "db8c0cae29f0e604cd9c2726a2d688b686769571c8a02f2980330ca3696b1971",
37
- "plugins/_lib/admin/mail/section-kit.js": "c535e53de135858d9b65945c6f24fd17b0270f4d2e8bb27a5bb0c8e29366ceaa",
38
- "plugins/_lib/admin/mail/when-closed.js": "98f15dd49f94534ad455b20ee6716a9b8f3b061163b7ce4176739da8b9b4e1e6",
39
- "plugins/_lib/admin/mail/oauth-panel.js": "baa480ed1ae7f8c6d7f16a09430522a057d90bbfa2dc519ca89669801b7a0a35",
40
- "plugins/_lib/admin/mail/rules.js": "6d9f7e507fdafa8c1e2f1fd264044b51df65022f45936c366c5ce6d0e82c7070",
41
- "plugins/_lib/admin/mail/reader-kit.js": "f047a5d3476a48f8cc1b1f1b038f005c992227406b89f97186b832b72b163bf3",
42
- "plugins/_lib/admin/mail/panes.js": "db060b30e9d7553b0a762fe8e0ec79537bf816fb82330d1c6ce83b480bf469a7",
43
- "plugins/_lib/admin/mail/contacts.js": "92ac6621a2580a08e749caf3b59d3acec9d4caf4d9128606f270de5e92d31985",
44
- "plugins/_lib/admin/mail/message-actions.js": "5dc6c0a5d226119b1215b398000a22f00f93b0806777c892cd122170287c7e46",
45
- "plugins/_lib/admin/mail/resizable.js": "fa7109005145dab1db06360ee0a0a3e69ab4129951f37544ea88ba02cd01bef1",
46
- "plugins/_lib/admin/mail/settings-section.js": "79e4011a0dfdade1521da33c8b02cd5b62983a43797f7ad2f283a0842722c346",
47
- "plugins/_lib/admin/mail/compose-window.js": "f1609ad2553eb7039b5fb2769ea13f025cce1e3e8bbde84499934ad2e8079ed3",
48
- "plugins/_lib/admin/mail/folder-tree.js": "603549149a090a84c39fb362e90022e77b10078117bb0f0cc6861b9c4e2d4413",
49
- "plugins/_lib/admin/mail/body-menu.js": "d86a43736d68b83eb9695e6ad6aefafe8b9a4fa049cfa8767ca3a24b7972ac82",
50
- "plugins/_lib/admin/mail/diagnostics-section.js": "f33ca1a3cfa67403dc2a5fd2367c0727e11a9e3023b2d2b96ed336f27a7b41aa",
51
- "plugins/_lib/admin/mail/drag-drop.js": "08dc3b170f192269f60176f33287397bb4f9c3b67d3119cbc32915a28528c785",
52
- "plugins/_lib/admin/mail/scheduling.js": "1420503885a65b93c60aaf0f7d7946f2d6d5991f3884c0df0050072830004261",
53
- "plugins/_lib/admin/mail/font-controls.js": "c998c3e98812cb641caeae0fe955be07393954ae82f4ded0cfb8bac3095584ce",
54
- "plugins/_lib/admin/mail/fonts.js": "1583f3735c3b77063f514c715c10c1041819392d4031bcbb8dd73c66d22db59a",
55
- "plugins/_lib/admin/mail/keyboard.js": "e03533e001eab4a9e4a15f3eb46ea2fa66a67d5a4ea7eb330d1204bec9bf4b05",
56
- "plugins/_lib/admin/mail/mail.css": "5e428fd53c3ec83983dc9545a0716b24c4bcd848b8b54647500afd4416c35c71",
57
- "plugins/_lib/admin/mail/reader-view.js": "fd9bfd42c3b81aa658e8a25ee6856a08a8befb82142246c62c7bae1d8a5d9442",
58
- "plugins/_lib/admin/mail/templates.js": "b60e12ac36677eebf9f3f3a66154676577727bf966b548e3515ccbf999385307",
59
- "plugins/_lib/admin/mail/security-note.js": "c11a691e4b9a42b2badb799b7ccfdbc9a1dc30e11424db0aadced8f8291324ed",
60
- "plugins/_lib/admin/ui/dates.js": "58cda00ba6aad4af142bb1aca9a40595d92d376ff4aa1860284abfbde7da98d3",
61
- "plugins/_lib/mail/compose.js": "0795d461472034073e1adfe93e32bf004a4b02cd44bedd9004e2fe4c55e03671",
62
- "plugins/_lib/admin/mail/reader-runtime.js": "731a273a8328dc94e020f53e06b6335ea56ef71537a12d1e267eb01536c5ff4d",
63
- "plugins/_lib/admin/mail/host-context.js": "f9cc6c69111977041e1bd7fff5cedf1cf14ef3c550386cf018d992d85e989d80",
64
- "plugins/_lib/admin/mail/cms-host.js": "3da445259ceba78d4eee93ca17a4299abad7a5fec8cd0286fd4dd5b0027e5869",
65
- "plugins/_lib/admin/ui/resizable.js": "c1e7c0198d32de29f92e74ed003d9f2b5da2587d54419113506c6304b570a2c7",
66
- "plugins/_lib/mail/store.js": "6a4b14263cf3435785055414a818d675e32df0adb73ecd0c721533c4ab281909",
67
- "plugins/_lib/mail/syncSelection.js": "7423aa28d609c29c21c1fc10a31a25f9c8f7cf1546afa0c31c7cf480a3282d90",
68
- "plugins/_lib/mail/pollerRuntime.js": "a8326f6aec334f3b2fb1ca58ff57fae9cf819583f3badc98f48c5c32a74661f5",
69
- "plugins/_lib/mail/poller.js": "2b03a2cad212361ea58fc3fd3ba13faad52f77c4e1dbb4c2544eab4e22c9c4f6",
70
- "plugins/_lib/mail/syncRuntime.js": "decb815a08d2e1c606ca5adf28adf4fa2c75b6d91365a9ca2f889ef4f04b222e",
71
- "plugins/_lib/mail/write.js": "fce8db9e49229294090152c75f260e005d7d59861ccc58c6d6ead3cf3fd89e04",
72
- "plugins/_lib/admin/mail/restore-spam.js": "8e6d26c0f3f53777f49b0e4254c283205417d9b1bb82884a2de9adc6115fc3b1",
73
- "plugins/_lib/mail/folders.js": "c0dda8464ede3cee14b6b3286c1c0bba37fe43a5af45292d522ff9d987b07b25",
74
- "plugins/_lib/mail/folderActions.js": "411093c9ced5757b64ad6b4b4f7849bd34e02f9cdc31b9d0383068c7b94888d9",
75
- "plugins/_lib/mail/folderRuntime.js": "4cba43c83ad0e812e8560e9a48324ac6f8f6c96242eb077c83613605f2a9f36c",
76
- "plugins/_lib/mail/ruleRunner.js": "0bfb18d5ee9b06b1c638db2d7f8f2d83f238ba5de1dea359fe55a535f50808de",
77
- "plugins/_lib/mail/schedulerRuntime.js": "688f1388944607ea2035cee8c73dcf56560f37e460fbc9d0d44616ac0933cd81",
78
- "plugins/_lib/mail/snoozeRuntime.js": "8db6054c6d2a4a2fc7510bf93004cde2f209f23e5dd7c41a72d0c386c16def59",
79
- "plugins/_lib/mail/vacationRuntime.js": "d94fd0ccc14dc6ef972050ed8def20ef716502b57409314fc4a3beff61718837",
80
- "plugins/_lib/mail/mbox.js": "0eb28dd9ac29fbcbc13f7f4f8200559e48e97426de8c5023d0349f85d8e55cbf",
81
- "plugins/_lib/mail/sieve.js": "ffd54cb2240ae302f5b50a209fa9d92156e8c2e44f28e10372694c8bd6e9378b",
82
- "plugins/_lib/mail/oauthRuntime.js": "92954df893ec5c241e58710a4c08a5434fa986dada326f6dc7bccb7ce4feec79",
83
- "plugins/_lib/mail/oauthRouteRuntime.js": "f838ea20839309b222efd94e220c82613f3624230de866774381492427303c6d",
84
- "plugins/_lib/mail/oauthAccounts.js": "108147ccc747a582fbe92295c9bb924781cf8d9806722a29dc637f4159397573"
6
+ "plugins/_lib/mail/defaults.js": "17e405e39672c4a4e435ac1de0a8dc44de6500072b5212c68b302e3214c700c9",
7
+ "plugins/_lib/mail/priority.js": "fdbf22bb516e7b093eff8dbd89ff108cf6a259746cf08c9390fc9fc30751fd88",
8
+ "plugins/_lib/mail/envelope.js": "6eb8c058b56c81d8cd0aadeefb643d1f1f3edfae92f796ad73e4f883720335c8",
9
+ "plugins/_lib/mail/pollSchedule.js": "69a6e82c5b9e2ff58d0a36d086c4c57f3476d1c0febd35dce79bc6b890f28f27",
10
+ "plugins/_lib/mail/syncPlan.js": "1c2029aa6b665fdbf55e886a04deee01cf7e7ffb609b17710a9820efccc7a889",
11
+ "plugins/_lib/admin/mail/threads.js": "c0d32386afd2c70036a52cd655255a270aa54a7c6cbe221a2740f89a8baf0f4f",
12
+ "plugins/_lib/admin/mail/vacation.js": "64e179d6214be88b54c3bdd0727efac3837086610f73cfec30ac586a61d220f7",
13
+ "plugins/_lib/mail/secretProvider.js": "62b9117cbfe8870c385a47781d27f5382d29717c1b3a9b4472691d56976e8b30",
14
+ "plugins/_lib/mail/secretbox.js": "bf190d5fca28d841db1f040116c0530a322dd8984c38212ddbba33cb10d935b1",
15
+ "plugins/_lib/mail/bodyTokenProvider.js": "1c50fdddda9cb6d53672d10a9d80405bff736dd9926c59396c49e521a9a21786",
16
+ "plugins/_lib/mail/bodyTokens.js": "cadeeb4609cafece39b547d6baec560f560c567c303e426453f5170a73c0f839",
17
+ "plugins/_lib/mail/accountFileStore.js": "1da78ab0984ac19522a24fad28c3e4c2da2ff3a098f75aea56483e6c531b713c",
18
+ "plugins/_lib/mail/accountRepository.js": "829bf3a87a0df226139e0382577164e0a754a10372d94dc4402b9b025998837e",
19
+ "plugins/_lib/mail/accountRoutes.js": "b621362bfd5041abe8c06def12d22fa4a46e00ada86221351440b042530f4976",
20
+ "plugins/_lib/mail/networkAddresses.js": "0566123f0c0999fe1d74d7ee536a7db641b1050d58242a3abc941d4f8d0868bf",
21
+ "plugins/_lib/mail/networkPolicy.js": "040ff923f2f40d11a3ed2bf8d3472e6447e1108ac18e4a1a8956a7e7e2fcce53",
22
+ "plugins/_lib/mail/imapPoolRuntime.js": "ea2803a9c380eac260e94594caa8bcf99b40cc32d3629b9c672de5ee8a2e4850",
23
+ "plugins/_lib/mail/publicMailbox.js": "190d181f05142e325cd5c1cee76783bdb079f2942cec21a06b38f5a887ba1e2b",
24
+ "plugins/_lib/mail/render.js": "b9bb41f8741f8b2614ca4dca6b0a6cd123d490d5af9f032ae162f1097829821d",
25
+ "plugins/_lib/mail/unsubscribe.js": "ae393c63ad7d2c746f385f14e9ed2c7086e5c22ab615535be40f6d5f51e79592",
26
+ "plugins/_lib/mail/unreadBadge.js": "197a5427bd8316e3080cae210ee58328fa0ec767cd52db779bd6462403cd7e3d",
27
+ "plugins/_lib/mail/message-action.js": "f112fb7f41bb8ccac04b3512842195ed9d7dd8c76646e35ad1191597b4d3f334",
28
+ "plugins/_lib/admin/mail/identity.js": "b193af336043488c987080b71feec3115d0b70877ea27b28755751fade4fad16",
29
+ "plugins/_lib/mail/messageSecurityProvider.js": "d8eec2ff9a7abbf8ebab51b11036b8737954bb6914f621a0c19b20f4ddf8ccab",
30
+ "plugins/_lib/mail/messageSecurity.js": "9018d707088fdf036646d41b77d8a4f6573ba57df5593cb6fdda4ba7046bdb54",
31
+ "plugins/_lib/mail/smtpService.js": "6560c1b499ee3dcaac2faff101424e6ac1255e260aff26e47bb6f3fbb52ed6ad",
32
+ "plugins/_lib/mail/subscriptions.js": "c0bebeb34f70ce7f8fedc64c22e4fff0dd3b35eae43ad6a494fccfd67a0bda4b",
33
+ "plugins/_lib/mail/senderAuth.js": "e1aa044200ed3efb947d69e0789c512965b7264a81b2e3aafe9644e698f76a4f",
34
+ "plugins/_lib/mail/readRuntime.js": "e827e80e02fd7d7e90dacdb9c50a58cac636d16ac5b5c3148a2ff39113fd3b81",
35
+ "plugins/_lib/admin/mail/image-senders-section.js": "fde4fba0e19b5a82e032931c840613b326a504362269d126a2a8bb6b133c4884",
36
+ "plugins/_lib/admin/mail/mail.html": "5f3f1220daf8ef5eee29c71cde094e058c9a46777ffeba366e591c886abc4f0c",
37
+ "plugins/_lib/admin/mail/section-kit.js": "9be75951a496f3a31601b552d46f1a2fc98817f318270eb85841e3cca2ec6a11",
38
+ "plugins/_lib/admin/mail/when-closed.js": "0c053bcb2c094b8a595850549d4108fa5cec36e6d43c98bc70cdd5a26ba96fba",
39
+ "plugins/_lib/admin/mail/oauth-panel.js": "a3522fbd7b35590686634a9ac8bf07cdb1386d3b37ca70c93c4f094976f4b7cf",
40
+ "plugins/_lib/admin/mail/rules.js": "76e6e52cbbc4f569c3dbcde59a1a76e5d0bc717cbb5a5ffa4590213333787647",
41
+ "plugins/_lib/admin/mail/reader-kit.js": "25036a2d69ce1d39083ad47fc529c77ddb66e2e59e1d0458f9d63dce885385fd",
42
+ "plugins/_lib/admin/mail/panes.js": "04154509086b30802b95aa0130d38bcf5ab487fcbd8324996d82762c15ea7363",
43
+ "plugins/_lib/admin/mail/contacts.js": "bc0cbabfd9bdcb6910191aca457f92f32588d6c7c9584841e90da74354df98d0",
44
+ "plugins/_lib/admin/mail/message-actions.js": "9d5c75b29ef7bbe071e7cfa97db006ac7fd6388c72ae84ad8e3d6f2a7e33c90c",
45
+ "plugins/_lib/admin/mail/resizable.js": "773dd3d5f90858696872524e414ede877dfdf1431bf2d63e67980a6a47c585d4",
46
+ "plugins/_lib/admin/mail/settings-section.js": "193a164693a6d550580ce033b24dd483dc51acb2dacf26a269fb87237af146cb",
47
+ "plugins/_lib/admin/mail/compose-window.js": "6316ba198558cd59121a8da2d550f1a24676d4abede5af18b8d4ddb0e3d6f639",
48
+ "plugins/_lib/admin/mail/folder-tree.js": "81cc567e06f3401f6e5a45274f88e2de6230e5f9449c0a901000f8998315517a",
49
+ "plugins/_lib/admin/mail/body-menu.js": "039d0683edf43f3ca81f26033a84bbf06dad29b2822369948021c434b6ea1bb6",
50
+ "plugins/_lib/admin/mail/diagnostics-section.js": "8759d9ab634b94b8c4a2fdf47390a9454843789c14182b51193ccbeb78a5874c",
51
+ "plugins/_lib/admin/mail/drag-drop.js": "ddabd0eb2ec152e85eed03e4935a2985e5323a48725c377931511d835eae3687",
52
+ "plugins/_lib/admin/mail/scheduling.js": "8ce02b294f398b79516a70ae94e9215cca892f7856f1dee215caa4bb3c1e9845",
53
+ "plugins/_lib/admin/mail/font-controls.js": "5a062ff0e6dfe8964ce942e316f8de5d6d293bcfa8a5f53b6ba49e1410b8b73b",
54
+ "plugins/_lib/admin/mail/fonts.js": "c270c8103d8bea458edea06dd46e5a75c36c36547474f936389d34c6331e9501",
55
+ "plugins/_lib/admin/mail/keyboard.js": "2a134fd135133d86462916ad45692ca3fd571dba46dc9a4778760c28b74068df",
56
+ "plugins/_lib/admin/mail/mail.css": "52ff2f58406f4cc5805187feefc29206d2eef21a4de98da7805ee8781f2ec6a5",
57
+ "plugins/_lib/admin/mail/reader-view.js": "8bfe5ea2195cf8594876a07d868c97f9215b17dabf6cf4f1ba192ea7ecdfb0e3",
58
+ "plugins/_lib/admin/mail/templates.js": "d4aa3ca98fc4b868e85e6d6575ead44afd09dd67799285f6d0e8889f5bd2e290",
59
+ "plugins/_lib/admin/mail/security-note.js": "e36fb19a5b922b6fdbd0117f04da5a4dfc2aa6339844ae2e288b29cda53f026c",
60
+ "plugins/_lib/admin/ui/dates.js": "645909412293185cace072a4354939b41a96eaf2ff068ad936d18ffca0f4f18d",
61
+ "plugins/_lib/mail/compose.js": "7d69fd3592e586e91b06a24241c019018c59bd18ed13a825bdb70c663e406516",
62
+ "plugins/_lib/admin/mail/reader-runtime.js": "0e5b3bd54736dc62362fb42e4264dacacc48c6b529229dbec0169f589db2306d",
63
+ "plugins/_lib/admin/mail/host-context.js": "365187c26b1ade2a1dc023f3d24a8505f6adedfce275813ce1f725309dcf585c",
64
+ "plugins/_lib/admin/mail/cms-host.js": "59129d74a96f229914957e553640ee7abea6bd12c89a71608c8aa7ba263a7422",
65
+ "plugins/_lib/admin/ui/resizable.js": "77c869c91a6a15d9be235ef37d04cb0b9247b53d840c2e224be8bfffce6c3c2c",
66
+ "plugins/_lib/mail/store.js": "035ddb9201064d4114372b697a7b3f541fe0a43fdf464b4baf6aa83bc4183bf6",
67
+ "plugins/_lib/mail/syncSelection.js": "cf37bed4be1cc4e47fd10a6fa0c90c9d5e435549b424e4c9b61dc12a568c8ef8",
68
+ "plugins/_lib/mail/pollerRuntime.js": "03dadc53483371ca89ec274de1646f1476d151a30d9bc9c09df709a77f52f3bb",
69
+ "plugins/_lib/mail/poller.js": "0e623e5e7ad7e59c679b9caa9956ba3a7fe29e64299e7802665a91d47b66574e",
70
+ "plugins/_lib/mail/syncRuntime.js": "b4ca50b3191a9936c64238842569ff7f10308c19a8400e3cf8a88bffc9db14a4",
71
+ "plugins/_lib/mail/write.js": "4fe8e59053f0d9c6de663ba5b527481cde62254c1a37ffe817b21507af1ec562",
72
+ "plugins/_lib/admin/mail/restore-spam.js": "c145780f3e6dc71005f1c69983b8ae0b1a11cee2c6f6ce9134f97ecf2ca33d2b",
73
+ "plugins/_lib/mail/folders.js": "c732a30a6932d91b165fcf9456877053b520568ae4611d51bd2949eab7b8d037",
74
+ "plugins/_lib/mail/folderActions.js": "868dae933e09767984f731eccdb84f1d13baf4e54c284bbbe52c4d3a99d353b6",
75
+ "plugins/_lib/mail/folderRuntime.js": "9e2d27683ee9bf4848f02f6af01fe9f7abcd4cfa950f4cded8ae2fd46a2dc9d6",
76
+ "plugins/_lib/mail/ruleRunner.js": "a8568eac5a5ca32d957174fed37abfc92f0d0bb027c917e92238cac6625bcb4f",
77
+ "plugins/_lib/mail/schedulerRuntime.js": "e555c3e0a3db43b85640d6eff73cf5bc5b3b243cd2033c649951e0a58ee04367",
78
+ "plugins/_lib/mail/snoozeRuntime.js": "53eaaa72bf89605fafc27b372134c27f11fe61de20dd9b3876ab71e45612d110",
79
+ "plugins/_lib/mail/vacationRuntime.js": "c8589546f5a5aabc71b31b425026fb594a2eda8c00c06ff43b16359016c15413",
80
+ "plugins/_lib/mail/mbox.js": "823516fbce7a921d7ac7939211b66e4b7220f41959c33f32ebb300f521448781",
81
+ "plugins/_lib/mail/sieve.js": "68de9ddc2ce64a4aa54896de06c16b2816ab000c94de962eddc16609ac7f72db",
82
+ "plugins/_lib/mail/oauthRuntime.js": "3275b1a9d4af990eb4cf20393d5cdcaa48306f83ce36597e7aef414cdaaae189",
83
+ "plugins/_lib/mail/oauthRouteRuntime.js": "812bc030d2486c3062de8fb50bf839ba3c34ed811385c372042653b774159b35",
84
+ "plugins/_lib/mail/oauthAccounts.js": "88f422afae14dd1af941382a405ce682a8244332cf08f503aa105fc4b3c97ae0",
85
+ "plugins/_lib/public/rich-text.mjs": "1abcc27508dd91a5749e8e2ec115ce62744f12b56f69419b8872951725b64fa8",
86
+ "plugins/_lib/rich-text.js": "e0f21884ab336a23b90811f97f25d5e516651c3c52b2c20f4be638626efc9551",
87
+ "plugins/_lib/admin/ui/rich-field.js": "5ca3d574e02124fd512cc16d424bf2b705d662fe7b7a158c89707fe361a230dc"
85
88
  }
86
89
  }
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/accountFileStore.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountFileStore.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {randomUUID} from 'node:crypto';
4
4
  import fs from 'node:fs/promises';
@@ -1,11 +1,11 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/accountRepository.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountRepository.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  export const POLL_INTERVALS = Object.freeze([3, 5, 10, 15]);
4
4
  import {randomUUID} from 'node:crypto';
5
5
  import {normaliseIdentityList, findIdentity, bareAddress, signatureToText} from '../admin/mail/identity.js';
6
6
  import {normaliseTemplates} from '../admin/mail/templates.js';
7
7
  import {sanitiseSignature} from './render.js';
8
- import {normaliseVacation} from '../admin/mail/vacation.js';
8
+ import {activeAwayId, normaliseAwayMessages, normaliseVacation} from '../admin/mail/vacation.js';
9
9
  import {normaliseUndoSeconds} from '../admin/mail/scheduling.js';
10
10
  import {normaliseRules, normaliseRuleGroups, rulesInEffect} from '../admin/mail/rules.js';
11
11
 
@@ -604,6 +604,34 @@ export function createAccountRepository({store, secrets, isOAuth = account => ac
604
604
  });
605
605
  }
606
606
 
607
+ const awayMessagesToPublic = account => {
608
+ const messages = normaliseAwayMessages(account);
609
+ return {messages, activeId: activeAwayId(account, messages)};
610
+ };
611
+ /**
612
+ * Replace the saved away messages and which one is on. The one switched on is copied
613
+ * into `vacation` (what the runner reads); none on switches the away message off and
614
+ * leaves its text where it was.
615
+ */
616
+ async function setAwayMessages(userId, accountId, messages = [], activeId = null) {
617
+ const cleaned = normaliseAwayMessages({awayMessages: messages.map(m => {
618
+ const bodyHtml = sanitiseSignature(m?.bodyHtml ?? '');
619
+ return {...m, bodyHtml, bodyText: m?.bodyText ?? signatureToText(bodyHtml)};
620
+ })});
621
+ const active = cleaned.find(m => m.id === activeId) ?? null;
622
+ await withStoreLock(async () => {
623
+ const all = await readAll();
624
+ const index = all.findIndex(account => account.id === accountId && account.userId === userId);
625
+ if (index === -1) return;
626
+ all[index] = {...all[index], awayMessages: cleaned, awayActiveId: active?.id ?? null, updatedAt: new Date().toISOString()};
627
+ await writeAll(all);
628
+ });
629
+ const current = normaliseVacation(await getAccount(userId, accountId));
630
+ return setVacation(userId, accountId, active
631
+ ? {...active, enabled: true}
632
+ : {...current, enabled: false});
633
+ }
634
+
607
635
  const snoozeFolder = account => String(account?.snoozeFolder ?? '').trim() || 'Snoozed';
608
636
  const undoSendSeconds = account => normaliseUndoSeconds(account?.undoSendSeconds);
609
637
  async function setSendingOptions(userId, accountId, options = {}) {
@@ -668,5 +696,5 @@ export function createAccountRepository({store, secrets, isOAuth = account => ac
668
696
  return all[index];
669
697
  });
670
698
  }
671
- return {sieveToPublic, setSieve, vacationToPublic, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, isOAuth, validate, listAccounts, setDefaultAccount, getAccount, saveAccount, deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection, setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed};
699
+ return {sieveToPublic, setSieve, vacationToPublic, awayMessagesToPublic, setAwayMessages, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, isOAuth, validate, listAccounts, setDefaultAccount, getAccount, saveAccount, deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection, setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed};
672
700
  }
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/accountRoutes.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountRoutes.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {MailKeyError} from './secretProvider.js';
4
4
 
@@ -472,7 +472,7 @@ export async function setComposeOptions(userId, accountId, options) {
472
472
 
473
473
  /** Account lifecycle is authored in domma-mail/packages/core/src/mail/accountRepository.js. */
474
474
  export const {
475
- sieveToPublic, setSieve, vacationToPublic, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, validate, listAccounts, setDefaultAccount, getAccount, saveAccount,
475
+ sieveToPublic, setSieve, vacationToPublic, awayMessagesToPublic, setAwayMessages, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, validate, listAccounts, setDefaultAccount, getAccount, saveAccount,
476
476
  deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection,
477
477
  setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed
478
478
  } = baseAccounts;
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/bodyTokenProvider.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/bodyTokenProvider.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {createHmac, timingSafeEqual} from 'node:crypto';
4
4
 
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/bodyTokens.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/bodyTokens.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** CMS compatibility entry point for the existing iframe grant API. */
4
4
  import {resolveKeySource} from './secretbox.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/compose.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/compose.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Turning a message into a reply, and a reply into something sendable.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/defaults.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/defaults.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Reading defaults, shared by every edition.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/envelope.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/envelope.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The shape the mirror holds one message in.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/folderActions.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/folderActions.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Whole-folder operations use a snapshot of UIDs, never the visible page or a moving '*'. */
4
4
  import {moveBulk, setFlagsBulk} from './write.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/folderRuntime.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/folderRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Portable folder operations. Hosts supply ownership, serialization and metadata updates. */
4
4
  import {validateFolderName, buildFolderPath, renameTarget, canModifyFolder, descendantsOf, moveTarget, resolveSubscriptions} from './folders.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/folders.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/folders.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {resolveSubscriptions} from './subscriptions.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.29.1, packages/core/src/mail/imapPoolRuntime.js.
1
+ // Source: @domma-mail/core 0.32.0, packages/core/src/mail/imapPoolRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * IMAP connection pool for the Mail Reader plugin.