domma-cms 1.10.37 → 1.10.39
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/CHANGELOG.md +10 -0
- package/admin/js/lib/mail-compose.js +1 -1
- package/admin/js/lib/sidebar-notify.js +1 -0
- package/admin/js/lib/sidebar-renderer.js +5 -5
- package/package.json +2 -1
- package/plugins/_lib/admin/mail/compose-window.js +138 -20
- package/plugins/_lib/admin/mail/mail.css +1 -1
- package/plugins/_lib/admin/mail/reader-view.js +74 -10
- package/plugins/_lib/admin/mail/rules.js +81 -0
- package/plugins/_lib/admin/mail/security-note.js +68 -0
- package/plugins/_lib/admin/mail/settings-section.js +205 -18
- package/plugins/_lib/mail/accounts.js +86 -3
- package/plugins/_lib/mail/compose.js +15 -1
- package/plugins/_lib/mail/message-action.js +32 -0
- package/plugins/_lib/mail/messageSecurity.js +111 -0
- package/plugins/_lib/mail/readRoutes.js +36 -6
- package/plugins/_lib/mail/send.js +105 -23
- package/plugins/_lib/mail/store.js +23 -1
- package/plugins/_lib/mail/sync.js +4 -1
- package/plugins/_lib/mail/unreadBadge.js +24 -1
- package/plugins/_lib/mail/vacationRunner.js +4 -1
- package/server/routes/api/sidebar-counts.js +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @param {{label?: string, unseen: number|null, error?: string}[]} boxes - one per mailbox
|
|
18
|
+
* @param {{id?: string, label?: string, unseen: number|null, uidNext?: number|null, error?: string}[]} boxes - one per mailbox
|
|
19
19
|
* @returns {{count: number, label: string, tone: string, details: object}}
|
|
20
20
|
*/
|
|
21
21
|
export function unreadBadge(boxes = []) {
|
|
@@ -31,6 +31,7 @@ export function unreadBadge(boxes = []) {
|
|
|
31
31
|
// shown even at 0 - otherwise a broken password reads as "all read".
|
|
32
32
|
tone: failed ? 'danger' : 'info',
|
|
33
33
|
...(failed ? {showZero: true} : {}),
|
|
34
|
+
...newMailNotice(known),
|
|
34
35
|
details: {
|
|
35
36
|
title: 'Mail',
|
|
36
37
|
rows: boxes.map(b => ({
|
|
@@ -43,3 +44,25 @@ export function unreadBadge(boxes = []) {
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The sidebar's "new mail" signal (admin/js/lib/sidebar-notify.js): one mark
|
|
50
|
+
* per mailbox with unread mail - the inbox's newest UID, which only rises when
|
|
51
|
+
* something arrives. STATUS has no sender or subject, so the notice says how
|
|
52
|
+
* many and where.
|
|
53
|
+
*
|
|
54
|
+
* @param {object[]} boxes - the reachable ones
|
|
55
|
+
* @returns {{notify?: object}}
|
|
56
|
+
*/
|
|
57
|
+
function newMailNotice(boxes) {
|
|
58
|
+
const marks = {};
|
|
59
|
+
const where = [];
|
|
60
|
+
for (const box of boxes) {
|
|
61
|
+
const uidNext = Number(box.uidNext);
|
|
62
|
+
if (!box.id || !(box.unseen > 0) || !Number.isFinite(uidNext) || uidNext < 2) continue;
|
|
63
|
+
marks[box.id] = uidNext - 1;
|
|
64
|
+
where.push(`${plural(box.unseen, 'unread message')} in ${String(box.label || 'your inbox')}`);
|
|
65
|
+
}
|
|
66
|
+
if (!where.length) return {};
|
|
67
|
+
return {notify: {marks, title: 'New mail', body: where.join('; ')}};
|
|
68
|
+
}
|
|
@@ -97,7 +97,10 @@ export async function runVacation({
|
|
|
97
97
|
// Not filed. One holiday produces a hundred of these, and a
|
|
98
98
|
// Sent folder that is mostly "Out of office" is one nobody can
|
|
99
99
|
// find anything in - the reply log is the audit trail instead.
|
|
100
|
-
fileCopy: false
|
|
100
|
+
fileCopy: false,
|
|
101
|
+
// So the mailbox's rules about leaving (secure delivery) apply
|
|
102
|
+
// to its away message too.
|
|
103
|
+
account
|
|
101
104
|
});
|
|
102
105
|
|
|
103
106
|
// Recorded AFTER it has gone. The other order would mean a send
|
|
@@ -55,7 +55,7 @@ export async function sidebarCountRoutes(fastify, opts = {}) {
|
|
|
55
55
|
const count = Number(value);
|
|
56
56
|
if (value == null || !Number.isFinite(count) || count < 0) { answers.set(url, null); continue; }
|
|
57
57
|
if (typeof answer !== 'object') answers.set(url, count);
|
|
58
|
-
else answers.set(url, Object.fromEntries(['count', 'label', 'tone', 'inventory', 'showZero', 'details']
|
|
58
|
+
else answers.set(url, Object.fromEntries(['count', 'label', 'tone', 'inventory', 'showZero', 'details', 'notify']
|
|
59
59
|
.filter(key => answer[key] !== undefined).map(key => [key, answer[key]])));
|
|
60
60
|
} catch { answers.set(url, null); }
|
|
61
61
|
finally { clearTimeout(timer); }
|