@open-workspace/email 0.3.0 → 0.4.1
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/README.md +22 -22
- package/alchemy/index.ts +273 -0
- package/drizzle/mailbox/0000_puzzling_dracula.sql +149 -0
- package/drizzle/mailbox/0001_mute_jack_flag.sql +12 -0
- package/drizzle/mailbox/meta/0000_snapshot.json +1002 -0
- package/drizzle/mailbox/meta/0001_snapshot.json +1002 -0
- package/drizzle/mailbox/meta/_journal.json +20 -0
- package/drizzle/mailbox/migrations.js +12 -0
- package/index.ts +3 -1
- package/migrations/{0000_email.sql → 0000_dry_moon_knight.sql} +26 -20
- package/migrations/meta/0000_snapshot.json +125 -109
- package/migrations/meta/_journal.json +2 -2
- package/package.json +74 -68
- package/shared/attachment-preview.ts +37 -27
- package/shared/folder-order.ts +106 -0
- package/shared/mail-authentication.ts +8 -3
- package/shared/mail-feedback.ts +18 -25
- package/shared/mail-headers.ts +114 -39
- package/shared/mail-import.ts +38 -0
- package/shared/mail-path.ts +42 -0
- package/shared/mail-received.ts +174 -31
- package/shared/mail-remote.ts +59 -2
- package/shared/mail-sender-intel.ts +22 -4
- package/shared/mail.ts +77 -28
- package/shared/module.ts +33 -0
- package/shared/office-preview.ts +14 -2
- package/shared/pdfjs-assets.ts +35 -0
- package/shared/permissions.ts +73 -0
- package/shared/webhooks.ts +41 -0
- package/src/admin/blocked-senders.tsx +189 -0
- package/src/client.tsx +97 -0
- package/src/lib/mail-api.ts +9 -0
- package/src/mail/attachment-preview-dialog.tsx +161 -0
- package/src/mail/blocked-senders.tsx +138 -0
- package/src/mail/compose-window-chrome.tsx +194 -0
- package/src/mail/compose-window.tsx +486 -0
- package/src/mail/composer-asset-bookmarks.ts +409 -0
- package/src/mail/composer-asset.tsx +229 -0
- package/src/mail/composer-attachment-list.tsx +138 -0
- package/src/mail/composer-editor-document.ts +65 -0
- package/src/mail/composer-editor.tsx +284 -0
- package/src/mail/composer-linked-attachment-text.ts +12 -0
- package/src/mail/composer-recipient-fields.tsx +165 -0
- package/src/mail/composer-recipients.ts +208 -0
- package/src/mail/composer-session.ts +562 -0
- package/src/mail/composer-toolbar.tsx +303 -0
- package/src/mail/composer-upload-client.ts +105 -0
- package/src/mail/composer-upload-progress.ts +53 -0
- package/src/mail/conversation-list.tsx +550 -0
- package/src/mail/conversation-loading-skeleton.tsx +119 -0
- package/src/mail/conversation-message.tsx +346 -0
- package/src/mail/conversation-reply.tsx +470 -0
- package/src/mail/conversation-selection-toolbar.tsx +322 -0
- package/src/mail/conversation-view.tsx +437 -0
- package/src/mail/delivery-indicator.tsx +272 -0
- package/src/mail/email-html-body.tsx +203 -0
- package/src/mail/folder-glyph.tsx +46 -0
- package/src/mail/folder-manager.tsx +532 -0
- package/src/mail/format-bytes.ts +7 -0
- package/src/mail/mail-app-bar.tsx +253 -0
- package/src/mail/mail-background.tsx +12 -0
- package/src/mail/mail-dock.tsx +137 -0
- package/src/mail/mail-folders.ts +44 -0
- package/src/mail/mail-layout.css +236 -0
- package/src/mail/mail-location.ts +73 -0
- package/src/mail/mail-mailbox-sheet.tsx +275 -0
- package/src/mail/mail-nav-rail.tsx +129 -0
- package/src/mail/mail-nav.tsx +324 -0
- package/src/mail/mail-prefetch.ts +59 -0
- package/src/mail/mail-primitives.tsx +66 -0
- package/src/mail/mail-queries.ts +209 -0
- package/src/mail/mail-query-cache.ts +486 -0
- package/src/mail/mail-seed.ts +47 -0
- package/src/mail/mail-shell.tsx +126 -0
- package/src/mail/mailbox-ai-settings.tsx +185 -0
- package/src/mail/mailbox-realtime.tsx +251 -0
- package/src/mail/mailbox-route.tsx +15 -0
- package/src/mail/message-actions.tsx +353 -0
- package/src/mail/message-attachments.tsx +200 -0
- package/src/mail/message-format.ts +75 -0
- package/src/mail/message-header.tsx +260 -0
- package/src/mail/message-translation.tsx +225 -0
- package/src/mail/original-message-sheet.tsx +619 -0
- package/src/mail/original-message.ts +191 -0
- package/src/mail/outbound-notification.ts +53 -0
- package/src/mail/pane-splitter.tsx +117 -0
- package/src/mail/pdf-preview-toolbar.tsx +152 -0
- package/src/mail/pdf-preview.css +44 -0
- package/src/mail/pdf-preview.tsx +156 -0
- package/src/mail/pdf-translation-layout.ts +95 -0
- package/src/mail/print-message.ts +92 -0
- package/src/mail/reader-pane.tsx +535 -0
- package/src/mail/recipient-combobox.tsx +335 -0
- package/src/mail/recipient-field-row.tsx +34 -0
- package/src/mail/reply-to-warning.tsx +50 -0
- package/src/mail/sanitize-email-html.ts +430 -0
- package/src/mail/sender-actions.tsx +149 -0
- package/src/mail/sender-authentication.tsx +485 -0
- package/src/mail/sender-dialogs.tsx +384 -0
- package/src/mail/sender-security.tsx +545 -0
- package/src/mail/toolbar-tooltip.tsx +29 -0
- package/src/mail/translation-html.ts +49 -0
- package/src/mail/translation-language.ts +21 -0
- package/src/mail/types.ts +53 -0
- package/src/mail/unread-document-indicator.tsx +60 -0
- package/src/mail/use-compose-submission.ts +208 -0
- package/src/mail/use-composer-attachment-preflight.ts +184 -0
- package/src/mail/use-composer-submission.ts +117 -0
- package/src/mail/use-conversation-selection.ts +186 -0
- package/src/mail/use-mail-controller.ts +427 -0
- package/src/mail/use-mail-data.ts +279 -0
- package/src/mail/use-mail-safety.ts +155 -0
- package/src/mail/use-mail-send.ts +142 -0
- package/src/mail/use-pdf-translation-overlay.ts +156 -0
- package/src/mail/use-pdf-translation.ts +100 -0
- package/src/mail/use-pdf-viewer.ts +215 -0
- package/src/mail/use-reply-submission.ts +114 -0
- package/src/mail/use-sanitized-email-html.ts +20 -0
- package/src/mail/use-visible-message-read.ts +138 -0
- package/src/pwa/push-subscription.ts +151 -0
- package/src/settings/mail-apps-page.tsx +235 -0
- package/src/settings/notifications-page.tsx +291 -0
- package/worker/admin/blocked-sender-routes.ts +166 -0
- package/worker/admin/schemas.ts +11 -0
- package/worker/bindings.d.ts +14 -10
- package/worker/db/schema.ts +63 -40
- package/worker/jmap/eventsource.ts +84 -16
- package/worker/jmap/methods.ts +1630 -524
- package/worker/jmap/push-types.ts +27 -0
- package/worker/jmap/push.ts +140 -56
- package/worker/jmap/routes.ts +366 -105
- package/worker/mail/access.ts +258 -21
- package/worker/mail/ai-classification.ts +36 -20
- package/worker/mail/ai-translation.ts +13 -6
- package/worker/mail/auth-headers.ts +395 -137
- package/worker/mail/bimi.ts +200 -73
- package/worker/mail/bootstrap.ts +79 -0
- package/worker/mail/capped-body.ts +36 -0
- package/worker/mail/classification-signals.ts +35 -25
- package/worker/mail/conversation-cursor.ts +30 -19
- package/worker/mail/delivery-events.ts +88 -62
- package/worker/mail/delivery-facts.ts +46 -10
- package/worker/mail/demo-routes.ts +34 -10
- package/worker/mail/doh.ts +62 -23
- package/worker/mail/downloads.ts +75 -40
- package/worker/mail/edge-cache.ts +155 -0
- package/worker/mail/header-metadata.ts +88 -22
- package/worker/mail/impersonation.ts +160 -38
- package/worker/mail/import-routes.ts +313 -0
- package/worker/mail/inbound-delivery.ts +19 -9
- package/worker/mail/inbound-threading.ts +18 -8
- package/worker/mail/inbound.ts +82 -40
- package/worker/mail/ip-intel.ts +110 -27
- package/worker/mail/isolate-cache.ts +35 -0
- package/worker/mail/link-domains.ts +29 -7
- package/worker/mail/mailbox-deletion.ts +10 -4
- package/worker/mail/mailbox-directory.ts +16 -6
- package/worker/mail/mailing-list.ts +94 -39
- package/worker/mail/message-security.ts +90 -15
- package/worker/mail/message-view.ts +18 -6
- package/worker/mail/office-conversion.ts +31 -9
- package/worker/mail/office-preview-container.ts +40 -13
- package/worker/mail/office-preview-queue.ts +76 -32
- package/worker/mail/org-domain.ts +8 -1
- package/worker/mail/outbound-content.ts +71 -26
- package/worker/mail/outbound-delivery.ts +31 -17
- package/worker/mail/outbound-service.ts +48 -30
- package/worker/mail/outbound-threading.ts +30 -17
- package/worker/mail/outbound.ts +97 -70
- package/worker/mail/outgoing-context.ts +25 -15
- package/worker/mail/participants.ts +44 -29
- package/worker/mail/push-notifications.ts +271 -173
- package/worker/mail/quote-parser.ts +21 -10
- package/worker/mail/r2-presigned-urls.ts +31 -25
- package/worker/mail/receive.ts +23 -11
- package/worker/mail/recipients.ts +6 -1
- package/worker/mail/remote-proxy.ts +187 -31
- package/worker/mail/remote-routes.ts +87 -0
- package/worker/mail/remote-token.ts +104 -0
- package/worker/mail/repeat.ts +19 -0
- package/worker/mail/reply-plan.ts +62 -33
- package/worker/mail/rfc.ts +32 -7
- package/worker/mail/routes.ts +870 -541
- package/worker/mail/safety-routes.ts +328 -200
- package/worker/mail/schemas.ts +84 -105
- package/worker/mail/search.ts +1 -0
- package/worker/mail/security-settings.ts +41 -9
- package/worker/mail/sender-intel.ts +206 -51
- package/worker/mail/spamhaus.ts +92 -45
- package/worker/mail/unsubscribe.ts +76 -18
- package/worker/mail/uploads.ts +126 -93
- package/worker/mail/webhook-source.ts +35 -12
- package/worker/mail/workspace-safety.ts +97 -38
- package/worker/mailbox/demo-html.ts +7 -7
- package/worker/mailbox/demo-seed.ts +10 -44
- package/worker/mailbox/demo.ts +595 -225
- package/worker/mailbox/email-index.ts +53 -0
- package/worker/mailbox/folder-model.ts +53 -17
- package/worker/mailbox/import-placement.ts +88 -0
- package/worker/mailbox/inbox-counts.ts +106 -0
- package/worker/mailbox/index.ts +1734 -721
- package/worker/mailbox/jmap-store.ts +139 -35
- package/worker/mailbox/model.ts +8 -6
- package/worker/mailbox/office-preview-jobs.ts +56 -25
- package/worker/mailbox/schema.ts +87 -66
- package/worker/mailbox/senders.ts +176 -70
- package/worker/mcp/mail-action-tools.ts +128 -87
- package/worker/mcp/mail-compose-tools.ts +133 -82
- package/worker/mcp/mail-query-tools.ts +120 -71
- package/worker/mcp/mail-safety-tools.ts +321 -248
- package/worker/mcp/schemas.ts +43 -0
- package/worker/mcp/tools.ts +13 -10
- package/worker/module.ts +43 -18
- package/worker/sql.d.ts +8 -0
- package/alchemy.ts +0 -142
- package/containers/office-preview/Dockerfile +0 -10
- package/shared/mail-rules.ts +0 -156
- package/worker/admin/report-routes.ts +0 -164
- package/worker/mail/reported-messages.ts +0 -68
- package/worker/mailbox/migrations.ts +0 -10
- package/worker/mailbox/rules.ts +0 -110
package/worker/mailbox/demo.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { required } from "@open-workspace/core/shared";
|
|
2
|
+
|
|
1
3
|
import type { AuthResult, DmarcPolicy } from "../../shared/mail-authentication";
|
|
2
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
SenderIntel,
|
|
6
|
+
SpamhausListing,
|
|
7
|
+
} from "../../shared/mail-sender-intel";
|
|
3
8
|
import { inboundHeaderMetadata } from "../mail/auth-headers";
|
|
4
9
|
import { bimiObjectKey } from "../mail/bimi";
|
|
5
10
|
import { DEMO_UNSUBSCRIBE_HOST } from "../mail/demo-routes";
|
|
6
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
marginNotesHtml,
|
|
13
|
+
canvaslyInvoiceHtml,
|
|
14
|
+
hirelineHtml,
|
|
15
|
+
} from "./demo-html";
|
|
7
16
|
import type { EmailAiClassification, MailAddress } from "./model";
|
|
8
|
-
import type { MailRuleInput } from "./rules";
|
|
9
17
|
import type { NewEmail, NewFolder } from "./schema";
|
|
10
18
|
|
|
11
19
|
type DemoInput = {
|
|
@@ -40,12 +48,22 @@ type DemoAuthentication = {
|
|
|
40
48
|
mailFrom: string;
|
|
41
49
|
spf: AuthResult;
|
|
42
50
|
spfHelo: AuthResult;
|
|
43
|
-
dkim:
|
|
51
|
+
dkim: {
|
|
52
|
+
domain: string;
|
|
53
|
+
selector: string;
|
|
54
|
+
result: AuthResult;
|
|
55
|
+
signs: string[];
|
|
56
|
+
}[];
|
|
44
57
|
dmarc: AuthResult;
|
|
45
58
|
policy: DmarcPolicy | null;
|
|
46
59
|
spamScore: number;
|
|
47
60
|
/** Delivered through a forwarder that sealed an ARC set first. */
|
|
48
|
-
forwardedVia?: {
|
|
61
|
+
forwardedVia?: {
|
|
62
|
+
sealer: string;
|
|
63
|
+
authservId: string;
|
|
64
|
+
helo: string;
|
|
65
|
+
ip: string;
|
|
66
|
+
};
|
|
49
67
|
};
|
|
50
68
|
|
|
51
69
|
/**
|
|
@@ -64,8 +82,8 @@ type DemoIntel = {
|
|
|
64
82
|
registry?: string;
|
|
65
83
|
/** As if a Spamhaus DQS key were configured. */
|
|
66
84
|
spamhaus?: {
|
|
67
|
-
zen?:
|
|
68
|
-
dbl?:
|
|
85
|
+
zen?: Pick<SpamhausListing, "code" | "list" | "severity">[];
|
|
86
|
+
dbl?: { domain: string; code: string; list: string }[];
|
|
69
87
|
domains: string[];
|
|
70
88
|
};
|
|
71
89
|
/** The From domain serves the demo BIMI logo seeded next to the rows. */
|
|
@@ -95,16 +113,23 @@ function demoRawKey(id: string) {
|
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
function mimeAddress(address: MailAddress) {
|
|
98
|
-
return address.name
|
|
116
|
+
return address.name
|
|
117
|
+
? `"${address.name}" <${address.address}>`
|
|
118
|
+
: address.address;
|
|
99
119
|
}
|
|
100
120
|
|
|
101
121
|
function demoToken(seed: string, length: number) {
|
|
102
|
-
const alphabet =
|
|
122
|
+
const alphabet =
|
|
123
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
124
|
+
|
|
103
125
|
let hash = 2_166_136_261;
|
|
126
|
+
|
|
104
127
|
for (let index = 0; index < seed.length; index += 1) {
|
|
105
128
|
hash = Math.imul(hash ^ seed.charCodeAt(index), 16_777_619) >>> 0;
|
|
106
129
|
}
|
|
130
|
+
|
|
107
131
|
let token = "";
|
|
132
|
+
|
|
108
133
|
while (token.length < length) {
|
|
109
134
|
// xorshift32 keeps the demo signatures stable between seeds and renders.
|
|
110
135
|
hash ^= hash << 13;
|
|
@@ -113,13 +138,21 @@ function demoToken(seed: string, length: number) {
|
|
|
113
138
|
hash >>>= 0;
|
|
114
139
|
token += alphabet[hash % alphabet.length];
|
|
115
140
|
}
|
|
141
|
+
|
|
116
142
|
return token;
|
|
117
143
|
}
|
|
118
144
|
|
|
119
145
|
function spfComment(result: AuthResult, identity: string, ip: string) {
|
|
120
|
-
if (result === "pass")
|
|
146
|
+
if (result === "pass") {
|
|
147
|
+
return `domain of ${identity} designates ${ip} as permitted sender`;
|
|
148
|
+
}
|
|
149
|
+
|
|
121
150
|
if (result === "none") return `no SPF records found for ${identity}`;
|
|
122
|
-
|
|
151
|
+
|
|
152
|
+
if (result === "softfail") {
|
|
153
|
+
return `domain of transitioning ${identity} does not designate ${ip} as permitted sender`;
|
|
154
|
+
}
|
|
155
|
+
|
|
123
156
|
return `domain of ${identity} does not designate ${ip} as permitted sender`;
|
|
124
157
|
}
|
|
125
158
|
|
|
@@ -129,14 +162,20 @@ function folded(prefix: string, parts: string[]) {
|
|
|
129
162
|
}
|
|
130
163
|
|
|
131
164
|
/** Cloudflare's prepended header block, topmost first, as seen on production mail. */
|
|
132
|
-
function cloudflareHeaders(
|
|
165
|
+
function cloudflareHeaders(
|
|
166
|
+
input: DemoInput,
|
|
167
|
+
auth: DemoAuthentication,
|
|
168
|
+
at: (offsetMs: number) => string
|
|
169
|
+
) {
|
|
133
170
|
const fromDomain = input.from.address.split("@")[1] ?? "invalid";
|
|
134
171
|
const recipient = input.to[0]?.address ?? "user@demo.example";
|
|
135
172
|
const instance = auth.forwardedVia ? 2 : 1;
|
|
173
|
+
|
|
136
174
|
const results = [
|
|
137
175
|
...(auth.dkim.length
|
|
138
|
-
? auth.dkim.map(
|
|
139
|
-
|
|
176
|
+
? auth.dkim.map(
|
|
177
|
+
(dkim) =>
|
|
178
|
+
`dkim=${dkim.result} header.d=${dkim.domain} header.s=${dkim.selector} header.b=${demoToken(`${input.id}${dkim.domain}`, 8)}`
|
|
140
179
|
)
|
|
141
180
|
: ["dkim=none"]),
|
|
142
181
|
`dmarc=${auth.dmarc} header.from=${fromDomain}${auth.policy ? ` policy.dmarc=${auth.policy}` : ""}`,
|
|
@@ -144,6 +183,7 @@ function cloudflareHeaders(input: DemoInput, auth: DemoAuthentication, at: (offs
|
|
|
144
183
|
`spf=${auth.spf} (mx.cloudflare.net: ${spfComment(auth.spf, auth.mailFrom, auth.ip)}) smtp.mailfrom=${auth.mailFrom}`,
|
|
145
184
|
`arc=${auth.forwardedVia ? "pass" : "none"} smtp.remote-ip=${auth.ip}`,
|
|
146
185
|
];
|
|
186
|
+
|
|
147
187
|
return [
|
|
148
188
|
`Received: from ${auth.helo} (${auth.ip})`,
|
|
149
189
|
`\tby cloudflare-email.net (cloudflare) id ${demoToken(input.id, 12)}`,
|
|
@@ -153,7 +193,10 @@ function cloudflareHeaders(input: DemoInput, auth: DemoAuthentication, at: (offs
|
|
|
153
193
|
`ARC-Message-Signature: i=${instance}; a=rsa-sha256; s=cf2024-1; d=cloudflare-email.net; c=relaxed/relaxed;`,
|
|
154
194
|
"\th=To:Subject:From:Date:from:reply-to:cc:in-reply-to:references:list-id; bh=",
|
|
155
195
|
`\t${demoToken(`${input.id}bh`, 43)}=; b=${demoToken(`${input.id}ams`, 64)}`,
|
|
156
|
-
folded(
|
|
196
|
+
folded(
|
|
197
|
+
`ARC-Authentication-Results: i=${instance}; mx.cloudflare.net`,
|
|
198
|
+
results
|
|
199
|
+
),
|
|
157
200
|
`Received-SPF: ${auth.spf} (mx.cloudflare.net: ${spfComment(auth.spf, auth.mailFrom, auth.ip)})`,
|
|
158
201
|
`\treceiver=mx.cloudflare.net; client-ip=${auth.ip}; envelope-from="${auth.mailFrom}"; helo=${auth.helo};`,
|
|
159
202
|
folded("Authentication-Results: mx.cloudflare.net", results),
|
|
@@ -161,11 +204,17 @@ function cloudflareHeaders(input: DemoInput, auth: DemoAuthentication, at: (offs
|
|
|
161
204
|
];
|
|
162
205
|
}
|
|
163
206
|
|
|
164
|
-
function forwarderHeaders(
|
|
207
|
+
function forwarderHeaders(
|
|
208
|
+
input: DemoInput,
|
|
209
|
+
auth: DemoAuthentication,
|
|
210
|
+
at: (offsetMs: number) => string
|
|
211
|
+
) {
|
|
165
212
|
const via = auth.forwardedVia;
|
|
213
|
+
|
|
166
214
|
if (!via) return [];
|
|
167
215
|
const fromDomain = input.from.address.split("@")[1] ?? "invalid";
|
|
168
216
|
const original = auth.dkim.find((dkim) => dkim.domain === fromDomain);
|
|
217
|
+
|
|
169
218
|
return [
|
|
170
219
|
`ARC-Seal: i=1; a=rsa-sha256; t=1793000000; cv=none; d=${via.sealer}; s=arc-20240605;`,
|
|
171
220
|
`\tb=${demoToken(`${input.id}upseal`, 64)}`,
|
|
@@ -177,7 +226,7 @@ function forwarderHeaders(input: DemoInput, auth: DemoAuthentication, at: (offse
|
|
|
177
226
|
`dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=${fromDomain}`,
|
|
178
227
|
]),
|
|
179
228
|
`Received: by 2001:db8:4864:20::62a with SMTP id ${demoToken(`${input.id}fw`, 10)};`,
|
|
180
|
-
`\t${at(-
|
|
229
|
+
`\t${at(-2000)}`,
|
|
181
230
|
folded(`Authentication-Results: ${via.authservId}`, [
|
|
182
231
|
`dkim=pass header.i=@${fromDomain} header.s=${original?.selector ?? "mail"}`,
|
|
183
232
|
`spf=pass smtp.mailfrom=${input.from.address}`,
|
|
@@ -186,7 +235,7 @@ function forwarderHeaders(input: DemoInput, auth: DemoAuthentication, at: (offse
|
|
|
186
235
|
`Received: from ${via.helo} (${via.helo} [${via.ip}])`,
|
|
187
236
|
`\tby ${via.authservId} with ESMTPS id ${demoToken(`${input.id}mx`, 10)}`,
|
|
188
237
|
`\tfor <${input.to[0]?.address ?? "user@demo.example"}>`,
|
|
189
|
-
`\t(Google Transport Security); ${at(-
|
|
238
|
+
`\t(Google Transport Security); ${at(-3000)}`,
|
|
190
239
|
];
|
|
191
240
|
}
|
|
192
241
|
|
|
@@ -201,19 +250,31 @@ function dkimSignatureHeaders(input: DemoInput, auth: DemoAuthentication) {
|
|
|
201
250
|
|
|
202
251
|
/** A plausible RFC 5322 original for the "Show original" view. */
|
|
203
252
|
function demoRawMime(input: DemoInput, now: number) {
|
|
204
|
-
const date = new Date(now - input.ageMs)
|
|
205
|
-
|
|
253
|
+
const date = new Date(now - input.ageMs)
|
|
254
|
+
.toUTCString()
|
|
255
|
+
.replace("GMT", "+0000");
|
|
256
|
+
|
|
206
257
|
const at = (offsetMs: number) =>
|
|
207
|
-
new Date(now - input.ageMs + offsetMs)
|
|
208
|
-
|
|
258
|
+
new Date(now - input.ageMs + offsetMs)
|
|
259
|
+
.toUTCString()
|
|
260
|
+
.replace("GMT", "+0000");
|
|
261
|
+
|
|
262
|
+
const { checks } = input;
|
|
209
263
|
const auth = checks?.authentication;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
264
|
+
|
|
265
|
+
const senderHops =
|
|
266
|
+
!auth || checks?.direct || auth.forwardedVia
|
|
267
|
+
? []
|
|
268
|
+
: [
|
|
269
|
+
"Received: from app-3.internal ([10.12.4.8])",
|
|
270
|
+
`\tby ${auth.helo} with ESMTPSA id ${input.id}-out; ${at(-4000)}`,
|
|
271
|
+
];
|
|
272
|
+
|
|
273
|
+
const unsubscribeId = demoToken(`${input.id}unsubscribe`, 16).replaceAll(
|
|
274
|
+
/[+/]/gu,
|
|
275
|
+
"x"
|
|
276
|
+
);
|
|
277
|
+
|
|
217
278
|
const headers = [
|
|
218
279
|
...(auth ? cloudflareHeaders(input, auth, at) : []),
|
|
219
280
|
...(auth ? forwarderHeaders(input, auth, at) : []),
|
|
@@ -222,7 +283,9 @@ function demoRawMime(input: DemoInput, now: number) {
|
|
|
222
283
|
`From: ${mimeAddress(input.from)}`,
|
|
223
284
|
...(input.replyTo ? [`Reply-To: ${mimeAddress(input.replyTo)}`] : []),
|
|
224
285
|
`To: ${input.to.map(mimeAddress).join(", ")}`,
|
|
225
|
-
...(input.cc?.length
|
|
286
|
+
...(input.cc?.length
|
|
287
|
+
? [`Cc: ${input.cc.map(mimeAddress).join(", ")}`]
|
|
288
|
+
: []),
|
|
226
289
|
`Subject: ${input.subject}`,
|
|
227
290
|
`Date: ${date}`,
|
|
228
291
|
`Message-ID: ${input.messageId}`,
|
|
@@ -238,11 +301,22 @@ function demoRawMime(input: DemoInput, now: number) {
|
|
|
238
301
|
: []),
|
|
239
302
|
"MIME-Version: 1.0",
|
|
240
303
|
];
|
|
241
|
-
|
|
304
|
+
|
|
305
|
+
const text = input.body.replaceAll("\n", "\r\n");
|
|
306
|
+
|
|
242
307
|
if (!input.html) {
|
|
243
|
-
return [
|
|
308
|
+
return [
|
|
309
|
+
...headers,
|
|
310
|
+
"Content-Type: text/plain; charset=utf-8",
|
|
311
|
+
"Content-Transfer-Encoding: 8bit",
|
|
312
|
+
"",
|
|
313
|
+
text,
|
|
314
|
+
"",
|
|
315
|
+
].join("\r\n");
|
|
244
316
|
}
|
|
317
|
+
|
|
245
318
|
const boundary = `demo-${input.id}`;
|
|
319
|
+
|
|
246
320
|
return [
|
|
247
321
|
...headers,
|
|
248
322
|
`Content-Type: multipart/alternative; boundary="${boundary}"`,
|
|
@@ -262,14 +336,19 @@ function demoRawMime(input: DemoInput, now: number) {
|
|
|
262
336
|
].join("\r\n");
|
|
263
337
|
}
|
|
264
338
|
|
|
265
|
-
function demoSenderIntel(
|
|
266
|
-
|
|
339
|
+
function demoSenderIntel(
|
|
340
|
+
input: DemoInput,
|
|
341
|
+
checkedAt: number
|
|
342
|
+
): SenderIntel | null {
|
|
343
|
+
const { checks } = input;
|
|
267
344
|
const intel = checks?.intel;
|
|
345
|
+
|
|
268
346
|
if (!checks || !intel) return null;
|
|
269
|
-
const ip = checks.authentication
|
|
347
|
+
const { ip } = checks.authentication;
|
|
270
348
|
const fromDomain = input.from.address.split("@")[1] ?? "invalid";
|
|
271
|
-
const fcrdns = intel.ptr ? intel.fcrdns ?? true : false;
|
|
349
|
+
const fcrdns = intel.ptr ? (intel.fcrdns ?? true) : false;
|
|
272
350
|
const helo = checks.authentication.helo.toLocaleLowerCase();
|
|
351
|
+
|
|
273
352
|
return {
|
|
274
353
|
version: 1,
|
|
275
354
|
source: "demo",
|
|
@@ -281,10 +360,12 @@ function demoSenderIntel(input: DemoInput, checkedAt: number): SenderIntel | nul
|
|
|
281
360
|
names: intel.ptr ? [intel.ptr] : [],
|
|
282
361
|
confirmed: intel.ptr && fcrdns ? intel.ptr : null,
|
|
283
362
|
fcrdns,
|
|
284
|
-
generic: intel.ptr ? intel.generic ?? false : null,
|
|
363
|
+
generic: intel.ptr ? (intel.generic ?? false) : null,
|
|
285
364
|
},
|
|
286
365
|
heloMatchesPtr: intel.ptr
|
|
287
|
-
? helo === intel.ptr ||
|
|
366
|
+
? helo === intel.ptr ||
|
|
367
|
+
helo.split(".").slice(-2).join(".") ===
|
|
368
|
+
intel.ptr.split(".").slice(-2).join(".")
|
|
288
369
|
: null,
|
|
289
370
|
network: {
|
|
290
371
|
status: "ok",
|
|
@@ -299,7 +380,11 @@ function demoSenderIntel(input: DemoInput, checkedAt: number): SenderIntel | nul
|
|
|
299
380
|
zen: {
|
|
300
381
|
status: "ok",
|
|
301
382
|
error: null,
|
|
302
|
-
listings: (intel.spamhaus.zen ?? []).map((listing) => ({
|
|
383
|
+
listings: (intel.spamhaus.zen ?? []).map((listing) => ({
|
|
384
|
+
zone: "zen",
|
|
385
|
+
target: ip,
|
|
386
|
+
...listing,
|
|
387
|
+
})),
|
|
303
388
|
},
|
|
304
389
|
dbl: {
|
|
305
390
|
status: "ok",
|
|
@@ -315,14 +400,22 @@ function demoSenderIntel(input: DemoInput, checkedAt: number): SenderIntel | nul
|
|
|
315
400
|
},
|
|
316
401
|
}
|
|
317
402
|
: null,
|
|
318
|
-
bimi: intel.bimi
|
|
403
|
+
bimi: intel.bimi
|
|
404
|
+
? { domain: fromDomain, status: "ok", reason: null }
|
|
405
|
+
: null,
|
|
319
406
|
};
|
|
320
407
|
}
|
|
321
408
|
|
|
409
|
+
/** The domain of a demo address; every one has one. */
|
|
410
|
+
function demoDomain(address: string) {
|
|
411
|
+
return required(address.split("@")[1], `${address} has a domain`);
|
|
412
|
+
}
|
|
413
|
+
|
|
322
414
|
function email(input: DemoInput, now: number): NewEmail {
|
|
323
415
|
const timelineAt = new Date(now - input.ageMs);
|
|
324
416
|
const outgoing = input.direction === "outgoing";
|
|
325
|
-
|
|
417
|
+
|
|
418
|
+
const message: NewEmail = {
|
|
326
419
|
id: input.id,
|
|
327
420
|
conversationId: input.conversationId,
|
|
328
421
|
direction: outgoing ? "outgoing" : "incoming",
|
|
@@ -339,23 +432,14 @@ function email(input: DemoInput, now: number): NewEmail {
|
|
|
339
432
|
bodyText: input.body,
|
|
340
433
|
bodyHtmlR2Key: input.html ? demoHtmlKey(input.id) : null,
|
|
341
434
|
rawMimeR2Key: input.checks ? demoRawKey(input.id) : null,
|
|
342
|
-
// Parsed by the production parser from the same original seeded into R2.
|
|
343
|
-
...(input.checks
|
|
344
|
-
? inboundHeaderMetadata({
|
|
345
|
-
rawHeaders: demoRawMime(input, now),
|
|
346
|
-
fromAddress: input.from.address,
|
|
347
|
-
envelopeFrom: input.checks.authentication.mailFrom,
|
|
348
|
-
now: timelineAt.getTime() + 1_000,
|
|
349
|
-
})
|
|
350
|
-
: {}),
|
|
351
435
|
envelopeFrom: input.checks?.authentication.mailFrom ?? null,
|
|
352
|
-
envelopeTo: outgoing ? null : input.to[0]?.address ?? null,
|
|
353
|
-
senderIntelJson: demoSenderIntel(input, timelineAt.getTime() +
|
|
436
|
+
envelopeTo: outgoing ? null : (input.to[0]?.address ?? null),
|
|
437
|
+
senderIntelJson: demoSenderIntel(input, timelineAt.getTime() + 1500),
|
|
354
438
|
aiClassificationJson: input.checks
|
|
355
439
|
? {
|
|
356
440
|
source: "ai",
|
|
357
441
|
model: "openai/gpt-6-luna",
|
|
358
|
-
processedAt: timelineAt.getTime() +
|
|
442
|
+
processedAt: timelineAt.getTime() + 2000,
|
|
359
443
|
...input.checks.ai,
|
|
360
444
|
}
|
|
361
445
|
: null,
|
|
@@ -366,65 +450,96 @@ function email(input: DemoInput, now: number): NewEmail {
|
|
|
366
450
|
recipient: recipient.address,
|
|
367
451
|
status: "delivered" as const,
|
|
368
452
|
eventId: `demo_${input.id}_${index}`,
|
|
369
|
-
eventAt: timelineAt.getTime() +
|
|
453
|
+
eventAt: timelineAt.getTime() + 1500,
|
|
370
454
|
smtpCode: "250",
|
|
371
455
|
detail: null,
|
|
372
456
|
}))
|
|
373
457
|
: [],
|
|
374
458
|
};
|
|
459
|
+
|
|
460
|
+
if (input.checks) {
|
|
461
|
+
// Parsed by the production parser from the same original seeded into R2.
|
|
462
|
+
Object.assign(
|
|
463
|
+
message,
|
|
464
|
+
inboundHeaderMetadata({
|
|
465
|
+
rawHeaders: demoRawMime(input, now),
|
|
466
|
+
fromAddress: input.from.address,
|
|
467
|
+
envelopeFrom: input.checks.authentication.mailFrom,
|
|
468
|
+
now: timelineAt.getTime() + 1000,
|
|
469
|
+
})
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return message;
|
|
375
474
|
}
|
|
376
475
|
|
|
377
|
-
const
|
|
476
|
+
const sam = { address: "sam@demo.example", name: "Sam Brooks" };
|
|
378
477
|
const support = { address: "support@demo.example", name: "Customer care" };
|
|
379
478
|
|
|
380
479
|
function demoInputs(mailboxId: string): DemoInput[] {
|
|
381
480
|
if (mailboxId === "mbx_demo_personal") {
|
|
382
481
|
return [
|
|
383
|
-
|
|
482
|
+
{
|
|
384
483
|
id: "msg_demo_01",
|
|
385
484
|
conversationId: "conv_demo_launch",
|
|
386
|
-
messageId: "<launch@
|
|
387
|
-
from: { address: "
|
|
388
|
-
to: [
|
|
485
|
+
messageId: "<launch@lumen.example>",
|
|
486
|
+
from: { address: "kai@lumen.example", name: "Kai Lindqvist" },
|
|
487
|
+
to: [sam],
|
|
389
488
|
subject: "The craft behind fast software",
|
|
390
|
-
preview:
|
|
391
|
-
|
|
489
|
+
preview:
|
|
490
|
+
"I kept thinking about our conversation on speed and quality. The teams that move fastest rarely skip the details.",
|
|
491
|
+
body: "Hey Sam,\n\nI kept thinking about our conversation on speed and quality. The teams that move fastest rarely skip the details — they make the right details easier to see.\n\nHere are the notes from our design review and the three decisions we should make this week.\n\nKai",
|
|
392
492
|
ageMs: 540_000,
|
|
393
|
-
}
|
|
394
|
-
|
|
493
|
+
},
|
|
494
|
+
{
|
|
395
495
|
id: "msg_demo_07",
|
|
396
496
|
conversationId: "conv_demo_launch",
|
|
397
497
|
messageId: "<reply@openworkspace.demo>",
|
|
398
498
|
direction: "outgoing",
|
|
399
|
-
from:
|
|
400
|
-
to: [{ address: "
|
|
499
|
+
from: sam,
|
|
500
|
+
to: [{ address: "kai@lumen.example", name: "Kai Lindqvist" }],
|
|
401
501
|
subject: "Re: The craft behind fast software",
|
|
402
|
-
preview:
|
|
403
|
-
|
|
502
|
+
preview:
|
|
503
|
+
"That framing is exactly right. I turned the decisions into a smaller review doc.",
|
|
504
|
+
body: "That framing is exactly right. I turned the decisions into a smaller review doc and will send the final version tomorrow.\n\nThanks,\nSam",
|
|
404
505
|
ageMs: 180_000,
|
|
405
|
-
references: ["<launch@
|
|
406
|
-
}
|
|
407
|
-
|
|
506
|
+
references: ["<launch@lumen.example>"],
|
|
507
|
+
},
|
|
508
|
+
{
|
|
408
509
|
id: "msg_demo_02",
|
|
409
|
-
conversationId: "
|
|
410
|
-
messageId: "<workers@
|
|
411
|
-
from: { address: "jessica@
|
|
412
|
-
to: [
|
|
510
|
+
conversationId: "conv_demo_edgeworks",
|
|
511
|
+
messageId: "<workers@edgeworks.example>",
|
|
512
|
+
from: { address: "jessica@edgeworks.example", name: "Jessica Lee" },
|
|
513
|
+
to: [sam],
|
|
413
514
|
cc: [{ address: "maya@demo.example", name: "Maya Chen" }],
|
|
414
515
|
subject: "Your Workers architecture review",
|
|
415
|
-
preview:
|
|
416
|
-
|
|
516
|
+
preview:
|
|
517
|
+
"The per-mailbox SQLite design looks solid. Keeping raw MIME in R2 leaves the mailbox database focused.",
|
|
518
|
+
body: "Hi Sam,\n\nThe per-mailbox SQLite design looks solid. Keeping raw MIME in R2 leaves the mailbox database focused on RFC metadata and conversation state.\n\nI left a few notes on retries and idempotency below.\n\nBest,\nJessica",
|
|
417
519
|
ageMs: 4_200_000,
|
|
418
520
|
checks: {
|
|
419
521
|
mailer: "Apple Mail (2.3826.400)",
|
|
420
|
-
intel: {
|
|
522
|
+
intel: {
|
|
523
|
+
ptr: "mail-yw1-f42.google.com",
|
|
524
|
+
asn: 15_169,
|
|
525
|
+
asName: "Google LLC",
|
|
526
|
+
prefix: "198.51.100.0/24",
|
|
527
|
+
country: "US",
|
|
528
|
+
},
|
|
421
529
|
authentication: {
|
|
422
530
|
ip: "198.51.100.42",
|
|
423
|
-
helo: "smtp-out.
|
|
424
|
-
mailFrom: "jessica@
|
|
531
|
+
helo: "smtp-out.edgeworks.example",
|
|
532
|
+
mailFrom: "jessica@edgeworks.example",
|
|
425
533
|
spf: "pass",
|
|
426
534
|
spfHelo: "none",
|
|
427
|
-
dkim: [
|
|
535
|
+
dkim: [
|
|
536
|
+
{
|
|
537
|
+
domain: "edgeworks.example",
|
|
538
|
+
selector: "google",
|
|
539
|
+
result: "pass",
|
|
540
|
+
signs: ["from", "to", "cc", "subject", "date", "message-id"],
|
|
541
|
+
},
|
|
542
|
+
],
|
|
428
543
|
dmarc: "pass",
|
|
429
544
|
policy: "reject",
|
|
430
545
|
spamScore: 0,
|
|
@@ -434,61 +549,85 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
434
549
|
spamConfidence: 0.02,
|
|
435
550
|
folderId: null,
|
|
436
551
|
folderConfidence: 0.12,
|
|
437
|
-
reason:
|
|
552
|
+
reason:
|
|
553
|
+
"Personal work correspondence from a known contact replying to an architecture review.",
|
|
438
554
|
},
|
|
439
555
|
},
|
|
440
|
-
}
|
|
441
|
-
|
|
556
|
+
},
|
|
557
|
+
{
|
|
442
558
|
id: "msg_demo_03",
|
|
443
559
|
conversationId: "conv_demo_maya",
|
|
444
560
|
messageId: "<maya-update@demo>",
|
|
445
561
|
from: { address: "maya@demo.example", name: "Maya Chen" },
|
|
446
|
-
to: [
|
|
562
|
+
to: [sam],
|
|
447
563
|
subject: "Friday launch checklist",
|
|
448
|
-
preview:
|
|
564
|
+
preview:
|
|
565
|
+
"I grouped the remaining work into launch blockers and follow-ups. We are down to four real blockers.",
|
|
449
566
|
body: "I grouped the remaining work into launch blockers and follow-ups. We are down to four real blockers:\n\n1. Verify catch-all routing\n2. Run mobile QA\n3. Confirm outbound domain\n4. Write the setup guide\n\nEverything else can follow next week.",
|
|
450
567
|
ageMs: 86_400_000,
|
|
451
|
-
}
|
|
452
|
-
|
|
568
|
+
},
|
|
569
|
+
{
|
|
453
570
|
id: "msg_demo_04",
|
|
454
|
-
conversationId: "
|
|
455
|
-
messageId: "<design@
|
|
456
|
-
from: { address: "
|
|
457
|
-
to: [
|
|
571
|
+
conversationId: "conv_demo_vertex",
|
|
572
|
+
messageId: "<design@vertex.example>",
|
|
573
|
+
from: { address: "rafael@vertex.example", name: "Rafael Ortiz" },
|
|
574
|
+
to: [sam],
|
|
458
575
|
subject: "Re: interaction details",
|
|
459
|
-
preview:
|
|
576
|
+
preview:
|
|
577
|
+
"The reduced motion version feels right now. I would keep the mailbox transition almost instant.",
|
|
460
578
|
body: "The reduced-motion build is ready for review. I shortened the mailbox transition and kept the composer animation subtle.\n\nThe updated interaction notes are attached to the ticket.",
|
|
461
579
|
ageMs: 172_800_000,
|
|
462
|
-
}
|
|
463
|
-
|
|
580
|
+
},
|
|
581
|
+
{
|
|
464
582
|
id: "msg_demo_05",
|
|
465
583
|
conversationId: "conv_demo_weekly",
|
|
466
584
|
messageId: "<weekly@paper.demo>",
|
|
467
|
-
from: { address: "digest@
|
|
468
|
-
to: [
|
|
585
|
+
from: { address: "digest@margin-notes.example", name: "Margin Notes" },
|
|
586
|
+
to: [sam],
|
|
469
587
|
subject: "Issue 341 — tools for thought",
|
|
470
|
-
preview:
|
|
588
|
+
preview:
|
|
589
|
+
"A small collection of thoughtful products, strange links, and ideas worth carrying into the weekend.",
|
|
471
590
|
body: "A small collection of thoughtful products, strange links, and ideas worth carrying into the weekend.\n\nThis week: humane inboxes, local-first databases, and why fast tools feel calm.",
|
|
472
591
|
ageMs: 259_200_000,
|
|
473
|
-
html:
|
|
592
|
+
html: marginNotesHtml,
|
|
474
593
|
checks: {
|
|
475
594
|
mailer: "Campaigner 4.2",
|
|
476
|
-
intel: {
|
|
477
|
-
|
|
595
|
+
intel: {
|
|
596
|
+
ptr: "mta-7.campaigner-mail.example",
|
|
597
|
+
asn: 64_500,
|
|
598
|
+
asName: "Campaigner Mail Services",
|
|
599
|
+
prefix: "203.0.113.0/25",
|
|
600
|
+
country: "CA",
|
|
601
|
+
},
|
|
602
|
+
list: { id: "weekly.margin-notes.example" },
|
|
478
603
|
authentication: {
|
|
479
604
|
ip: "203.0.113.24",
|
|
480
605
|
helo: "mta-7.campaigner-mail.example",
|
|
481
|
-
mailFrom: "bounce-341-8812@mail.
|
|
606
|
+
mailFrom: "bounce-341-8812@mail.margin-notes.example",
|
|
482
607
|
spf: "pass",
|
|
483
608
|
spfHelo: "none",
|
|
484
609
|
dkim: [
|
|
485
610
|
{
|
|
486
|
-
domain: "
|
|
611
|
+
domain: "margin-notes.example",
|
|
487
612
|
selector: "cm1",
|
|
488
613
|
result: "pass",
|
|
489
|
-
signs: [
|
|
614
|
+
signs: [
|
|
615
|
+
"from",
|
|
616
|
+
"to",
|
|
617
|
+
"subject",
|
|
618
|
+
"date",
|
|
619
|
+
"message-id",
|
|
620
|
+
"list-id",
|
|
621
|
+
"list-unsubscribe",
|
|
622
|
+
"list-unsubscribe-post",
|
|
623
|
+
],
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
domain: "campaigner-mail.example",
|
|
627
|
+
selector: "esp",
|
|
628
|
+
result: "pass",
|
|
629
|
+
signs: ["from", "to", "subject", "date"],
|
|
490
630
|
},
|
|
491
|
-
{ domain: "campaigner-mail.example", selector: "esp", result: "pass", signs: ["from", "to", "subject", "date"] },
|
|
492
631
|
],
|
|
493
632
|
dmarc: "pass",
|
|
494
633
|
policy: "quarantine",
|
|
@@ -499,36 +638,44 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
499
638
|
spamConfidence: 0.07,
|
|
500
639
|
folderId: null,
|
|
501
640
|
folderConfidence: 0.22,
|
|
502
|
-
reason:
|
|
641
|
+
reason:
|
|
642
|
+
"Newsletter you subscribed to, with a working unsubscribe link and consistent sender.",
|
|
503
643
|
},
|
|
504
644
|
},
|
|
505
|
-
}
|
|
506
|
-
|
|
645
|
+
},
|
|
646
|
+
{
|
|
507
647
|
id: "msg_demo_06",
|
|
508
648
|
conversationId: "conv_demo_invoice",
|
|
509
|
-
messageId: "<invoice@
|
|
510
|
-
from: { address: "billing@
|
|
511
|
-
to: [
|
|
649
|
+
messageId: "<invoice@canvasly.example>",
|
|
650
|
+
from: { address: "billing@canvasly.example", name: "Canvasly" },
|
|
651
|
+
to: [sam],
|
|
512
652
|
subject: "Your July invoice",
|
|
513
653
|
preview: "Your invoice is ready. No action is required.",
|
|
514
654
|
body: "Your July invoice is ready. No action is required. You can find billing details in your workspace settings.",
|
|
515
655
|
ageMs: 432_000_000,
|
|
516
|
-
html:
|
|
517
|
-
}
|
|
518
|
-
|
|
656
|
+
html: canvaslyInvoiceHtml,
|
|
657
|
+
},
|
|
658
|
+
{
|
|
519
659
|
id: "msg_demo_13",
|
|
520
660
|
conversationId: "conv_demo_hiring",
|
|
521
661
|
messageId: "<position-closed@hireline.example>",
|
|
522
662
|
from: { address: "notifications@hireline.example", name: "Hireline" },
|
|
523
|
-
to: [
|
|
663
|
+
to: [sam],
|
|
524
664
|
subject: "This position is closed",
|
|
525
|
-
preview:
|
|
665
|
+
preview:
|
|
666
|
+
"You applied for Senior Frontend Engineer at Northwind Labs. The employer has closed this position.",
|
|
526
667
|
body: "This position is closed\n\nYou applied for Senior Frontend Engineer at Northwind Labs. The employer has closed this position.\n\nWe picked a few similar roles that match your profile. Good luck with your search!",
|
|
527
668
|
ageMs: 302_400_000,
|
|
528
669
|
html: hirelineHtml,
|
|
529
670
|
checks: {
|
|
530
671
|
mailer: "Hireline Notifier",
|
|
531
|
-
intel: {
|
|
672
|
+
intel: {
|
|
673
|
+
ptr: "out-12.sendhub-mail.example",
|
|
674
|
+
asn: 64_501,
|
|
675
|
+
asName: "SendHub Inc.",
|
|
676
|
+
prefix: "203.0.113.64/26",
|
|
677
|
+
country: "US",
|
|
678
|
+
},
|
|
532
679
|
list: { id: "alerts.hireline.example" },
|
|
533
680
|
// Sent through an ESP on its own domain, with no DMARC record for
|
|
534
681
|
// hireline.example: nothing ties the message to the From domain.
|
|
@@ -538,7 +685,14 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
538
685
|
mailFrom: "bounces+7731@sendhub-mail.example",
|
|
539
686
|
spf: "pass",
|
|
540
687
|
spfHelo: "pass",
|
|
541
|
-
dkim: [
|
|
688
|
+
dkim: [
|
|
689
|
+
{
|
|
690
|
+
domain: "sendhub-mail.example",
|
|
691
|
+
selector: "s1",
|
|
692
|
+
result: "pass",
|
|
693
|
+
signs: ["from", "to", "subject", "date", "list-unsubscribe"],
|
|
694
|
+
},
|
|
695
|
+
],
|
|
542
696
|
dmarc: "none",
|
|
543
697
|
policy: null,
|
|
544
698
|
spamScore: 1,
|
|
@@ -548,33 +702,48 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
548
702
|
spamConfidence: 0.18,
|
|
549
703
|
folderId: null,
|
|
550
704
|
folderConfidence: 0.31,
|
|
551
|
-
reason:
|
|
705
|
+
reason:
|
|
706
|
+
"Automated job-board notification about an application you submitted.",
|
|
552
707
|
},
|
|
553
708
|
},
|
|
554
|
-
}
|
|
555
|
-
|
|
709
|
+
},
|
|
710
|
+
{
|
|
556
711
|
id: "msg_demo_14",
|
|
557
712
|
conversationId: "conv_demo_offsite",
|
|
558
713
|
messageId: "<offsite-venues@northwind.example>",
|
|
559
714
|
from: { address: "priya@northwind.example", name: "Priya Nair" },
|
|
560
|
-
to: [
|
|
715
|
+
to: [sam],
|
|
561
716
|
subject: "Venue shortlist for the offsite",
|
|
562
|
-
preview:
|
|
563
|
-
|
|
717
|
+
preview:
|
|
718
|
+
"I narrowed the offsite venues down to three. All of them can host 40 people and have a quiet room for workshops.",
|
|
719
|
+
body: "Hi Sam,\n\nI narrowed the offsite venues down to three. All of them can host 40 people and have a quiet room for workshops.\n\nCould you pick your favourite by Thursday? I will book it the same day.\n\nPriya",
|
|
564
720
|
ageMs: 12_600_000,
|
|
565
721
|
checks: {
|
|
566
722
|
mailer: "Mozilla Thunderbird 140.2",
|
|
567
|
-
intel: {
|
|
568
|
-
|
|
723
|
+
intel: {
|
|
724
|
+
ptr: "mail-sor-f69.google.com",
|
|
725
|
+
asn: 15_169,
|
|
726
|
+
asName: "Google LLC",
|
|
727
|
+
prefix: "198.51.100.0/24",
|
|
728
|
+
country: "US",
|
|
729
|
+
},
|
|
730
|
+
// Sent to Sam's old address and forwarded by Gmail: SPF now checks
|
|
569
731
|
// Gmail's forwarding envelope, while the original DKIM signature and
|
|
570
732
|
// Gmail's ARC seal survive.
|
|
571
733
|
authentication: {
|
|
572
734
|
ip: "198.51.100.113",
|
|
573
735
|
helo: "mail-sor-f69.google.com",
|
|
574
|
-
mailFrom: "
|
|
736
|
+
mailFrom: "sam.old+caf_=sam=demo.example@gmail.com",
|
|
575
737
|
spf: "pass",
|
|
576
738
|
spfHelo: "pass",
|
|
577
|
-
dkim: [
|
|
739
|
+
dkim: [
|
|
740
|
+
{
|
|
741
|
+
domain: "northwind.example",
|
|
742
|
+
selector: "nw2026",
|
|
743
|
+
result: "pass",
|
|
744
|
+
signs: ["from", "to", "subject", "date", "message-id"],
|
|
745
|
+
},
|
|
746
|
+
],
|
|
578
747
|
dmarc: "pass",
|
|
579
748
|
policy: "quarantine",
|
|
580
749
|
spamScore: 0,
|
|
@@ -590,32 +759,48 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
590
759
|
spamConfidence: 0.03,
|
|
591
760
|
folderId: null,
|
|
592
761
|
folderConfidence: 0.1,
|
|
593
|
-
reason:
|
|
762
|
+
reason:
|
|
763
|
+
"A colleague asking for a decision on offsite venues, forwarded from another inbox.",
|
|
594
764
|
},
|
|
595
765
|
},
|
|
596
|
-
}
|
|
597
|
-
|
|
766
|
+
},
|
|
767
|
+
{
|
|
598
768
|
id: "msg_demo_15",
|
|
599
769
|
conversationId: "conv_demo_favour",
|
|
600
770
|
messageId: "<favour-4471@freemail.example>",
|
|
601
771
|
// An outsider borrowing a colleague's name from a freemail account.
|
|
602
772
|
from: { address: "maya.chen.desk@freemail.example", name: "Maya Chen" },
|
|
603
|
-
to: [
|
|
773
|
+
to: [sam],
|
|
604
774
|
subject: "Quick favour before my next meeting",
|
|
605
|
-
preview:
|
|
606
|
-
|
|
775
|
+
preview:
|
|
776
|
+
"Are you at your desk? I need you to handle a small purchase for a client today and I can't take calls.",
|
|
777
|
+
body: "Hi Sam,\n\nAre you at your desk? I need you to handle a small purchase for a client today and I can't take calls — I'm in back-to-back meetings.\n\nReply here as soon as you see this and I'll send the details.\n\nMaya",
|
|
607
778
|
ageMs: 1_500_000,
|
|
608
779
|
checks: {
|
|
609
780
|
direct: true,
|
|
610
781
|
mailer: "Freemail Webmail 9.4",
|
|
611
|
-
intel: {
|
|
782
|
+
intel: {
|
|
783
|
+
ptr: "smtp-out-3.freemail.example",
|
|
784
|
+
asn: 64_502,
|
|
785
|
+
asName: "Freemail Networks B.V.",
|
|
786
|
+
prefix: "198.51.100.128/25",
|
|
787
|
+
country: "NL",
|
|
788
|
+
registry: "ripencc",
|
|
789
|
+
},
|
|
612
790
|
authentication: {
|
|
613
791
|
ip: "198.51.100.177",
|
|
614
792
|
helo: "smtp-out-3.freemail.example",
|
|
615
793
|
mailFrom: "maya.chen.desk@freemail.example",
|
|
616
794
|
spf: "pass",
|
|
617
795
|
spfHelo: "pass",
|
|
618
|
-
dkim: [
|
|
796
|
+
dkim: [
|
|
797
|
+
{
|
|
798
|
+
domain: "freemail.example",
|
|
799
|
+
selector: "fm1",
|
|
800
|
+
result: "pass",
|
|
801
|
+
signs: ["from", "to", "subject", "date", "message-id"],
|
|
802
|
+
},
|
|
803
|
+
],
|
|
619
804
|
dmarc: "pass",
|
|
620
805
|
policy: "reject",
|
|
621
806
|
spamScore: 1,
|
|
@@ -625,32 +810,43 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
625
810
|
spamConfidence: 0.62,
|
|
626
811
|
folderId: null,
|
|
627
812
|
folderConfidence: 0,
|
|
628
|
-
reason:
|
|
813
|
+
reason:
|
|
814
|
+
"Urgent favour request from a free webmail account that uses a colleague's name; possible impersonation.",
|
|
629
815
|
},
|
|
630
816
|
},
|
|
631
|
-
}
|
|
632
|
-
|
|
817
|
+
},
|
|
818
|
+
{
|
|
633
819
|
id: "msg_demo_16",
|
|
634
820
|
conversationId: "conv_demo_password",
|
|
635
821
|
messageId: "<expiry-20931@demo-examp1e.com>",
|
|
636
|
-
from: {
|
|
637
|
-
|
|
822
|
+
from: {
|
|
823
|
+
address: "it-support@demo-examp1e.com",
|
|
824
|
+
name: "IT Service Desk",
|
|
825
|
+
},
|
|
826
|
+
to: [sam],
|
|
638
827
|
subject: "Action required: your mailbox password expires today",
|
|
639
|
-
preview:
|
|
640
|
-
|
|
828
|
+
preview:
|
|
829
|
+
"Your password for sam@demo.example expires in 4 hours. Keep your current password to avoid losing access.",
|
|
830
|
+
body: "Your password for sam@demo.example expires in 4 hours.\n\nKeep your current password to avoid losing access to mail and files:\nhttps://demo-examp1e.com/account/keep-password?u=sam\n\nIT Service Desk",
|
|
641
831
|
ageMs: 3_000_000,
|
|
642
832
|
checks: {
|
|
643
833
|
direct: true,
|
|
644
834
|
mailer: "PHPMailer 6.9",
|
|
645
835
|
intel: {
|
|
646
836
|
ptr: "vps-2207.cheap-cloud.example",
|
|
647
|
-
asn:
|
|
837
|
+
asn: 64_503,
|
|
648
838
|
asName: "Cheap Cloud VPS",
|
|
649
839
|
prefix: "203.0.113.192/26",
|
|
650
840
|
country: "RU",
|
|
651
841
|
registry: "ripencc",
|
|
652
842
|
spamhaus: {
|
|
653
|
-
dbl: [
|
|
843
|
+
dbl: [
|
|
844
|
+
{
|
|
845
|
+
domain: "demo-examp1e.com",
|
|
846
|
+
code: "127.0.1.4",
|
|
847
|
+
list: "DBL phishing domain",
|
|
848
|
+
},
|
|
849
|
+
],
|
|
654
850
|
domains: ["demo-examp1e.com"],
|
|
655
851
|
},
|
|
656
852
|
},
|
|
@@ -670,30 +866,46 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
670
866
|
spamConfidence: 0.71,
|
|
671
867
|
folderId: null,
|
|
672
868
|
folderConfidence: 0,
|
|
673
|
-
reason:
|
|
869
|
+
reason:
|
|
870
|
+
"Password-expiry notice from demo-examp1e.com, a lookalike of the workspace domain, with a credential link.",
|
|
674
871
|
},
|
|
675
872
|
},
|
|
676
|
-
}
|
|
677
|
-
|
|
873
|
+
},
|
|
874
|
+
{
|
|
678
875
|
id: "msg_demo_17",
|
|
679
876
|
conversationId: "conv_demo_meetup",
|
|
680
877
|
messageId: "<meetup-intro@harborlight.example>",
|
|
681
878
|
from: { address: "elena@harborlight.example", name: "Elena Petrova" },
|
|
682
|
-
to: [
|
|
879
|
+
to: [sam],
|
|
683
880
|
subject: "Intro: design systems meetup in November",
|
|
684
|
-
preview:
|
|
685
|
-
|
|
881
|
+
preview:
|
|
882
|
+
"Priya mentioned you have been rebuilding your mail client. Would you give a 15-minute talk at our meetup?",
|
|
883
|
+
body: "Hi Sam,\n\nPriya mentioned you have been rebuilding your mail client from scratch. We run a small design systems meetup and would love a 15-minute talk in November.\n\nNo slides needed — a live demo is perfect.\n\nElena",
|
|
686
884
|
ageMs: 6_000_000,
|
|
687
885
|
checks: {
|
|
688
886
|
mailer: "Mozilla Thunderbird 140.2",
|
|
689
|
-
intel: {
|
|
887
|
+
intel: {
|
|
888
|
+
ptr: "mx-out.harborlight.example",
|
|
889
|
+
asn: 64_504,
|
|
890
|
+
asName: "Harborlight Studio",
|
|
891
|
+
prefix: "198.51.100.0/27",
|
|
892
|
+
country: "PT",
|
|
893
|
+
registry: "ripencc",
|
|
894
|
+
},
|
|
690
895
|
authentication: {
|
|
691
896
|
ip: "198.51.100.12",
|
|
692
897
|
helo: "mx-out.harborlight.example",
|
|
693
898
|
mailFrom: "elena@harborlight.example",
|
|
694
899
|
spf: "pass",
|
|
695
900
|
spfHelo: "pass",
|
|
696
|
-
dkim: [
|
|
901
|
+
dkim: [
|
|
902
|
+
{
|
|
903
|
+
domain: "harborlight.example",
|
|
904
|
+
selector: "hl",
|
|
905
|
+
result: "pass",
|
|
906
|
+
signs: ["from", "to", "subject", "date", "message-id"],
|
|
907
|
+
},
|
|
908
|
+
],
|
|
697
909
|
dmarc: "pass",
|
|
698
910
|
policy: "quarantine",
|
|
699
911
|
spamScore: 0,
|
|
@@ -703,31 +915,50 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
703
915
|
spamConfidence: 0.04,
|
|
704
916
|
folderId: null,
|
|
705
917
|
folderConfidence: 0.08,
|
|
706
|
-
reason:
|
|
918
|
+
reason:
|
|
919
|
+
"A personal speaking invitation that references a mutual colleague.",
|
|
707
920
|
},
|
|
708
921
|
},
|
|
709
|
-
}
|
|
710
|
-
|
|
922
|
+
},
|
|
923
|
+
{
|
|
711
924
|
id: "msg_demo_18",
|
|
712
925
|
conversationId: "conv_demo_receipt",
|
|
713
926
|
messageId: "<receipt-1031@orbitalcloud.example>",
|
|
714
|
-
from: {
|
|
715
|
-
|
|
927
|
+
from: {
|
|
928
|
+
address: "billing@orbitalcloud.example",
|
|
929
|
+
name: "Orbital Cloud",
|
|
930
|
+
},
|
|
931
|
+
to: [sam],
|
|
716
932
|
subject: "Your October receipt",
|
|
717
|
-
preview:
|
|
933
|
+
preview:
|
|
934
|
+
"Thanks for your payment of $48.00 for the Team plan. Your next invoice is due on November 30.",
|
|
718
935
|
body: "Thanks for your payment of $48.00 for the Team plan.\n\nReceipt OC-1031 · Paid with card ending 4242\nYour next invoice is due on November 30.\n\nOrbital Cloud Billing",
|
|
719
936
|
ageMs: 20_000_000,
|
|
720
937
|
checks: {
|
|
721
938
|
direct: true,
|
|
722
939
|
mailer: "Orbital Billing",
|
|
723
|
-
intel: {
|
|
940
|
+
intel: {
|
|
941
|
+
ptr: "o12.mail.orbitalcloud.example",
|
|
942
|
+
asn: 64_505,
|
|
943
|
+
asName: "Orbital Cloud Inc.",
|
|
944
|
+
prefix: "203.0.113.0/26",
|
|
945
|
+
country: "US",
|
|
946
|
+
bimi: true,
|
|
947
|
+
},
|
|
724
948
|
authentication: {
|
|
725
949
|
ip: "203.0.113.12",
|
|
726
950
|
helo: "o12.mail.orbitalcloud.example",
|
|
727
951
|
mailFrom: "bounces@mail.orbitalcloud.example",
|
|
728
952
|
spf: "pass",
|
|
729
953
|
spfHelo: "pass",
|
|
730
|
-
dkim: [
|
|
954
|
+
dkim: [
|
|
955
|
+
{
|
|
956
|
+
domain: "orbitalcloud.example",
|
|
957
|
+
selector: "oc2026",
|
|
958
|
+
result: "pass",
|
|
959
|
+
signs: ["from", "to", "subject", "date", "message-id"],
|
|
960
|
+
},
|
|
961
|
+
],
|
|
731
962
|
dmarc: "pass",
|
|
732
963
|
policy: "reject",
|
|
733
964
|
spamScore: 0,
|
|
@@ -737,31 +968,53 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
737
968
|
spamConfidence: 0.02,
|
|
738
969
|
folderId: null,
|
|
739
970
|
folderConfidence: 0.15,
|
|
740
|
-
reason:
|
|
971
|
+
reason:
|
|
972
|
+
"Payment receipt from a service the mailbox already pays for, fully authenticated.",
|
|
741
973
|
},
|
|
742
974
|
},
|
|
743
|
-
}
|
|
744
|
-
|
|
975
|
+
},
|
|
976
|
+
{
|
|
745
977
|
id: "msg_demo_19",
|
|
746
978
|
conversationId: "conv_demo_bank_details",
|
|
747
979
|
messageId: "<inv-2207-update@paydesk-mailer.example>",
|
|
748
|
-
from: {
|
|
749
|
-
|
|
750
|
-
|
|
980
|
+
from: {
|
|
981
|
+
address: "accounts@northwind-supplies.example",
|
|
982
|
+
name: "Northwind Supplies Accounts",
|
|
983
|
+
},
|
|
984
|
+
replyTo: {
|
|
985
|
+
address: "northwind.accounts@quickmail.example",
|
|
986
|
+
name: "Northwind Supplies Accounts",
|
|
987
|
+
},
|
|
988
|
+
to: [sam],
|
|
751
989
|
subject: "Updated bank details for invoice INV-2207",
|
|
752
|
-
preview:
|
|
990
|
+
preview:
|
|
991
|
+
"Our bank has changed. Please send the payment for INV-2207 to the new account below by end of day.",
|
|
753
992
|
body: "Hello,\n\nOur bank has changed after an internal audit. Please send the payment for invoice INV-2207 (€18,400.00) to the new account below by end of day, and reply to confirm once it is done.\n\nIBAN: XX00 0000 0000 0000 0000 00\nReference: INV-2207\n\nKind regards,\nAccounts team",
|
|
754
993
|
ageMs: 1_800_000,
|
|
755
994
|
checks: {
|
|
756
995
|
mailer: "PayDesk Mailer 3.1",
|
|
757
|
-
intel: {
|
|
996
|
+
intel: {
|
|
997
|
+
ptr: "smtp-4.paydesk-mailer.example",
|
|
998
|
+
asn: 64_506,
|
|
999
|
+
asName: "PayDesk Mailer Ltd",
|
|
1000
|
+
prefix: "198.51.100.128/26",
|
|
1001
|
+
country: "NL",
|
|
1002
|
+
registry: "ripencc",
|
|
1003
|
+
},
|
|
758
1004
|
authentication: {
|
|
759
1005
|
ip: "198.51.100.140",
|
|
760
1006
|
helo: "smtp-4.paydesk-mailer.example",
|
|
761
1007
|
mailFrom: "bounce-2207@paydesk-mailer.example",
|
|
762
1008
|
spf: "pass",
|
|
763
1009
|
spfHelo: "pass",
|
|
764
|
-
dkim: [
|
|
1010
|
+
dkim: [
|
|
1011
|
+
{
|
|
1012
|
+
domain: "paydesk-mailer.example",
|
|
1013
|
+
selector: "pd1",
|
|
1014
|
+
result: "pass",
|
|
1015
|
+
signs: ["from", "to", "subject", "date", "reply-to"],
|
|
1016
|
+
},
|
|
1017
|
+
],
|
|
765
1018
|
dmarc: "none",
|
|
766
1019
|
policy: null,
|
|
767
1020
|
spamScore: 2,
|
|
@@ -771,34 +1024,102 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
771
1024
|
spamConfidence: 0.58,
|
|
772
1025
|
folderId: null,
|
|
773
1026
|
folderConfidence: 0,
|
|
774
|
-
reason:
|
|
1027
|
+
reason:
|
|
1028
|
+
"Payment redirection request whose replies go to a free-mail address; possible invoice fraud.",
|
|
775
1029
|
},
|
|
776
1030
|
},
|
|
777
|
-
}
|
|
1031
|
+
},
|
|
778
1032
|
];
|
|
779
1033
|
}
|
|
780
1034
|
|
|
781
1035
|
if (mailboxId === "mbx_demo_support") {
|
|
782
1036
|
return [
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
1037
|
+
{
|
|
1038
|
+
id: "msg_demo_08",
|
|
1039
|
+
conversationId: "conv_demo_customer1",
|
|
1040
|
+
messageId: "<help1@customer.demo>",
|
|
1041
|
+
from: { address: "noah@northstar.example", name: "Noah Williams" },
|
|
1042
|
+
to: [support],
|
|
1043
|
+
subject: "Can we use our own sending domain?",
|
|
1044
|
+
preview:
|
|
1045
|
+
"We are evaluating the product for our studio and need mail to come from our existing domain.",
|
|
1046
|
+
body: "Hi team,\n\nWe are evaluating the product for our studio and need mail to come from our existing domain. Is that supported, and which DNS records do we need to add?\n\nThanks,\nNoah",
|
|
1047
|
+
ageMs: 900_000,
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
id: "msg_demo_09",
|
|
1051
|
+
conversationId: "conv_demo_customer2",
|
|
1052
|
+
messageId: "<help2@customer.demo>",
|
|
1053
|
+
from: { address: "amina@harbor.example", name: "Amina Okafor" },
|
|
1054
|
+
to: [support],
|
|
1055
|
+
subject: "Importing an existing mailbox",
|
|
1056
|
+
preview:
|
|
1057
|
+
"Is there a recommended path for importing a few years of historical email?",
|
|
1058
|
+
body: "Hello,\n\nIs there a recommended path for importing a few years of historical email? We have roughly 18 GB and would like to preserve threads if possible.\n\nAmina",
|
|
1059
|
+
ageMs: 7_200_000,
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
id: "msg_demo_10",
|
|
1063
|
+
conversationId: "conv_demo_customer3",
|
|
1064
|
+
messageId: "<help3@customer.demo>",
|
|
1065
|
+
from: { address: "lea@atelier.example", name: "Léa Martin" },
|
|
1066
|
+
to: [support],
|
|
1067
|
+
subject: "Shared inbox notifications",
|
|
1068
|
+
preview:
|
|
1069
|
+
"Could each person choose which shared mailboxes should send browser notifications?",
|
|
1070
|
+
body: "Bonjour,\n\nCould each person choose which shared mailboxes should send browser notifications? We have support and press addresses, but not everyone needs both.\n\nMerci,\nLéa",
|
|
1071
|
+
ageMs: 97_200_000,
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
id: "msg_demo_11",
|
|
1075
|
+
conversationId: "conv_demo_customer3",
|
|
1076
|
+
messageId: "<support-reply@demo>",
|
|
1077
|
+
direction: "outgoing",
|
|
1078
|
+
from: support,
|
|
1079
|
+
to: [{ address: "lea@atelier.example", name: "Léa Martin" }],
|
|
1080
|
+
subject: "Re: Shared inbox notifications",
|
|
1081
|
+
preview:
|
|
1082
|
+
"Yes — notification preferences are per person and per mailbox.",
|
|
1083
|
+
body: "Hi Léa,\n\nYes — notification preferences are per person and per mailbox. You can stay in the shared inbox without receiving every browser notification.\n\nBest,\nMaya",
|
|
1084
|
+
ageMs: 90_000_000,
|
|
1085
|
+
references: ["<help3@customer.demo>"],
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
id: "msg_demo_12",
|
|
1089
|
+
conversationId: "conv_demo_spam",
|
|
1090
|
+
messageId: "<promo@spam.demo>",
|
|
1091
|
+
from: { address: "offers@growth-hack.invalid", name: "Growth Network" },
|
|
1092
|
+
to: [support],
|
|
1093
|
+
subject: "10x your pipeline overnight",
|
|
1094
|
+
preview: "One weird trick your competitors do not want you to know.",
|
|
1095
|
+
body: "One weird trick your competitors do not want you to know.",
|
|
1096
|
+
ageMs: 345_600_000,
|
|
788
1097
|
checks: {
|
|
789
1098
|
direct: true,
|
|
790
1099
|
intel: {
|
|
791
1100
|
ptr: "77-2-0-192.dyn.broadband-pool.example",
|
|
792
1101
|
fcrdns: false,
|
|
793
1102
|
generic: true,
|
|
794
|
-
asn:
|
|
1103
|
+
asn: 64_511,
|
|
795
1104
|
asName: "Bulk Hosting Ltd",
|
|
796
1105
|
prefix: "192.0.2.0/24",
|
|
797
1106
|
country: "SC",
|
|
798
1107
|
registry: "afrinic",
|
|
799
1108
|
spamhaus: {
|
|
800
|
-
zen: [
|
|
801
|
-
|
|
1109
|
+
zen: [
|
|
1110
|
+
{
|
|
1111
|
+
code: "127.0.0.4",
|
|
1112
|
+
list: "XBL (compromised host)",
|
|
1113
|
+
severity: "abuse",
|
|
1114
|
+
},
|
|
1115
|
+
],
|
|
1116
|
+
dbl: [
|
|
1117
|
+
{
|
|
1118
|
+
domain: "growth-hack.invalid",
|
|
1119
|
+
code: "127.0.1.2",
|
|
1120
|
+
list: "DBL spam domain",
|
|
1121
|
+
},
|
|
1122
|
+
],
|
|
802
1123
|
domains: ["growth-hack.invalid"],
|
|
803
1124
|
},
|
|
804
1125
|
},
|
|
@@ -808,7 +1129,14 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
808
1129
|
mailFrom: "offers@growth-hack.invalid",
|
|
809
1130
|
spf: "softfail",
|
|
810
1131
|
spfHelo: "none",
|
|
811
|
-
dkim: [
|
|
1132
|
+
dkim: [
|
|
1133
|
+
{
|
|
1134
|
+
domain: "bulk-sender.example",
|
|
1135
|
+
selector: "default",
|
|
1136
|
+
result: "pass",
|
|
1137
|
+
signs: ["from", "subject", "date"],
|
|
1138
|
+
},
|
|
1139
|
+
],
|
|
812
1140
|
dmarc: "fail",
|
|
813
1141
|
policy: "none",
|
|
814
1142
|
spamScore: 5,
|
|
@@ -818,14 +1146,36 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
818
1146
|
spamConfidence: 0.97,
|
|
819
1147
|
folderId: null,
|
|
820
1148
|
folderConfidence: 0,
|
|
821
|
-
reason:
|
|
1149
|
+
reason:
|
|
1150
|
+
"Unsolicited bulk promotion with exaggerated claims from a sender that fails SPF and DMARC.",
|
|
822
1151
|
},
|
|
823
|
-
}
|
|
824
|
-
|
|
1152
|
+
},
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
id: "msg_demo_20",
|
|
1156
|
+
conversationId: "conv_demo_quota",
|
|
1157
|
+
messageId: "<quota-77@mail-quota-alerts.example>",
|
|
1158
|
+
from: {
|
|
1159
|
+
address: "admin@mail-quota-alerts.example",
|
|
1160
|
+
name: "Mailbox Administrator",
|
|
1161
|
+
},
|
|
1162
|
+
to: [support],
|
|
1163
|
+
subject: "Your mailbox storage is full",
|
|
1164
|
+
preview:
|
|
1165
|
+
"Incoming messages are being held. Verify your account within 24 hours to release them.",
|
|
1166
|
+
body: "Your mailbox storage is full.\n\n14 incoming messages are being held. Verify your account within 24 hours to release them:\nhttps://mail-quota-alerts.example/verify?box=support\n\nMailbox Administrator",
|
|
1167
|
+
ageMs: 5_400_000,
|
|
825
1168
|
checks: {
|
|
826
1169
|
direct: true,
|
|
827
1170
|
mailer: "PHPMailer 6.9",
|
|
828
|
-
intel: {
|
|
1171
|
+
intel: {
|
|
1172
|
+
ptr: null,
|
|
1173
|
+
asn: 64_509,
|
|
1174
|
+
asName: "Anon VPS Hosting",
|
|
1175
|
+
prefix: "192.0.2.128/25",
|
|
1176
|
+
country: "PA",
|
|
1177
|
+
registry: "lacnic",
|
|
1178
|
+
},
|
|
829
1179
|
authentication: {
|
|
830
1180
|
ip: "192.0.2.201",
|
|
831
1181
|
helo: "localhost",
|
|
@@ -842,9 +1192,11 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
842
1192
|
spamConfidence: 0.91,
|
|
843
1193
|
folderId: null,
|
|
844
1194
|
folderConfidence: 0,
|
|
845
|
-
reason:
|
|
1195
|
+
reason:
|
|
1196
|
+
"Credential-harvesting storage warning from an unauthenticated sender with a verification link.",
|
|
846
1197
|
},
|
|
847
|
-
}
|
|
1198
|
+
},
|
|
1199
|
+
},
|
|
848
1200
|
];
|
|
849
1201
|
}
|
|
850
1202
|
|
|
@@ -852,43 +1204,59 @@ function demoInputs(mailboxId: string): DemoInput[] {
|
|
|
852
1204
|
}
|
|
853
1205
|
|
|
854
1206
|
/** A tiny self-made logo for the fictional orbitalcloud.example (SVG Tiny PS). */
|
|
855
|
-
const orbitalCloudLogo =
|
|
1207
|
+
const orbitalCloudLogo =
|
|
1208
|
+
'<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny-ps" viewBox="0 0 64 64"><title>Orbital Cloud</title><rect width="64" height="64" fill="#1e3a8a"/><circle cx="32" cy="32" r="11" fill="#f8fafc"/><ellipse cx="32" cy="32" rx="23" ry="8" fill="none" stroke="#7dd3fc" stroke-width="3" transform="rotate(-24 32 32)"/><circle cx="51" cy="24" r="3.5" fill="#fbbf24"/></svg>';
|
|
856
1209
|
|
|
857
1210
|
/**
|
|
858
1211
|
* Earlier correspondence the demo implies but does not seed as messages, so
|
|
859
1212
|
* known contacts do not all read as first-time senders.
|
|
860
1213
|
*/
|
|
861
1214
|
export function demoMailboxSenders(mailboxId: string, now = Date.now()) {
|
|
862
|
-
const known = (
|
|
1215
|
+
const known = (
|
|
1216
|
+
address: string,
|
|
1217
|
+
messageCount: number,
|
|
1218
|
+
outboundCount: number,
|
|
1219
|
+
firstSeenDaysAgo: number
|
|
1220
|
+
) => ({
|
|
863
1221
|
address,
|
|
864
|
-
domain: address
|
|
1222
|
+
domain: demoDomain(address),
|
|
865
1223
|
firstSeenAt: new Date(now - firstSeenDaysAgo * 86_400_000),
|
|
866
1224
|
lastSeenAt: new Date(now - 7 * 86_400_000),
|
|
867
1225
|
messageCount,
|
|
868
1226
|
outboundCount,
|
|
869
1227
|
lastOutboundAt: outboundCount ? new Date(now - 10 * 86_400_000) : null,
|
|
870
1228
|
});
|
|
1229
|
+
|
|
871
1230
|
if (mailboxId === "mbx_demo_personal") {
|
|
872
1231
|
return [
|
|
873
|
-
known("jessica@
|
|
874
|
-
known("
|
|
875
|
-
known("digest@
|
|
876
|
-
known("billing@
|
|
1232
|
+
known("jessica@edgeworks.example", 6, 4, 210),
|
|
1233
|
+
known("rafael@vertex.example", 9, 7, 400),
|
|
1234
|
+
known("digest@margin-notes.example", 40, 0, 300),
|
|
1235
|
+
known("billing@canvasly.example", 12, 0, 365),
|
|
877
1236
|
known("notifications@hireline.example", 5, 0, 60),
|
|
878
1237
|
known("priya@northwind.example", 14, 11, 500),
|
|
879
1238
|
known("billing@orbitalcloud.example", 9, 0, 280),
|
|
880
1239
|
known("accounts@northwind-supplies.example", 4, 2, 150),
|
|
881
1240
|
// Blocked before the demo starts: future mail from the domain goes to Spam.
|
|
882
|
-
{
|
|
1241
|
+
{
|
|
1242
|
+
address: "@prize-center.example",
|
|
1243
|
+
domain: "prize-center.example",
|
|
1244
|
+
blockedAt: new Date(now - 20 * 86_400_000),
|
|
1245
|
+
},
|
|
883
1246
|
];
|
|
884
1247
|
}
|
|
1248
|
+
|
|
885
1249
|
if (mailboxId === "mbx_demo_support") {
|
|
886
|
-
return [known("amina@harbor.
|
|
1250
|
+
return [known("amina@harbor.example", 2, 1, 30)];
|
|
887
1251
|
}
|
|
1252
|
+
|
|
888
1253
|
return [];
|
|
889
1254
|
}
|
|
890
1255
|
|
|
891
|
-
export function demoMailboxEmails(
|
|
1256
|
+
export function demoMailboxEmails(
|
|
1257
|
+
mailboxId: string,
|
|
1258
|
+
now = Date.now()
|
|
1259
|
+
): NewEmail[] {
|
|
892
1260
|
return demoInputs(mailboxId).map((input) => email(input, now));
|
|
893
1261
|
}
|
|
894
1262
|
|
|
@@ -896,24 +1264,43 @@ export function demoMailboxEmails(mailboxId: string, now = Date.now()): NewEmail
|
|
|
896
1264
|
export function demoMailboxObjects(mailboxId: string, now = Date.now()) {
|
|
897
1265
|
return demoInputs(mailboxId).flatMap((input) => [
|
|
898
1266
|
...(input.html
|
|
899
|
-
? [
|
|
1267
|
+
? [
|
|
1268
|
+
{
|
|
1269
|
+
key: demoHtmlKey(input.id),
|
|
1270
|
+
body: input.html,
|
|
1271
|
+
contentType: "text/html; charset=utf-8",
|
|
1272
|
+
},
|
|
1273
|
+
]
|
|
900
1274
|
: []),
|
|
901
1275
|
...(input.checks
|
|
902
|
-
? [
|
|
1276
|
+
? [
|
|
1277
|
+
{
|
|
1278
|
+
key: demoRawKey(input.id),
|
|
1279
|
+
body: demoRawMime(input, now),
|
|
1280
|
+
contentType: "message/rfc822",
|
|
1281
|
+
},
|
|
1282
|
+
]
|
|
903
1283
|
: []),
|
|
904
1284
|
...(input.checks?.intel?.bimi
|
|
905
|
-
? [
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1285
|
+
? [
|
|
1286
|
+
{
|
|
1287
|
+
key: bimiObjectKey(demoDomain(input.from.address)),
|
|
1288
|
+
body: orbitalCloudLogo,
|
|
1289
|
+
contentType: "image/svg+xml",
|
|
1290
|
+
customMetadata: {
|
|
1291
|
+
status: "ok",
|
|
1292
|
+
checkedAt: String(now),
|
|
1293
|
+
reason: "",
|
|
1294
|
+
},
|
|
1295
|
+
},
|
|
1296
|
+
]
|
|
911
1297
|
: []),
|
|
912
1298
|
]);
|
|
913
1299
|
}
|
|
914
1300
|
|
|
915
1301
|
export function demoMailboxFolders(mailboxId: string): NewFolder[] {
|
|
916
1302
|
if (mailboxId !== "mbx_demo_personal") return [];
|
|
1303
|
+
|
|
917
1304
|
return [
|
|
918
1305
|
{
|
|
919
1306
|
id: "Product",
|
|
@@ -931,6 +1318,7 @@ export function demoMailboxFolders(mailboxId: string): NewFolder[] {
|
|
|
931
1318
|
export function demoMailboxConversationState(mailboxId: string) {
|
|
932
1319
|
// Conversations the security actions move are reset on every demo login.
|
|
933
1320
|
const inbox = { mailboxState: "active" as const, folderId: null };
|
|
1321
|
+
|
|
934
1322
|
if (mailboxId === "mbx_demo_personal") {
|
|
935
1323
|
return [
|
|
936
1324
|
{ id: "conv_demo_weekly", ...inbox },
|
|
@@ -939,40 +1327,22 @@ export function demoMailboxConversationState(mailboxId: string) {
|
|
|
939
1327
|
{ id: "conv_demo_hiring", ...inbox },
|
|
940
1328
|
{ id: "conv_demo_receipt", ...inbox },
|
|
941
1329
|
{ id: "conv_demo_maya", folderId: "Product" },
|
|
942
|
-
{ id: "
|
|
1330
|
+
{ id: "conv_demo_vertex", folderId: "Pitch Decks" },
|
|
943
1331
|
{ id: "conv_demo_invoice", mailboxState: "archive" as const },
|
|
944
1332
|
];
|
|
945
1333
|
}
|
|
1334
|
+
|
|
946
1335
|
if (mailboxId === "mbx_demo_support") {
|
|
947
1336
|
return [
|
|
948
1337
|
{ id: "conv_demo_spam", mailboxState: "spam" as const },
|
|
949
1338
|
{ id: "conv_demo_quota", mailboxState: "spam" as const },
|
|
950
1339
|
];
|
|
951
1340
|
}
|
|
952
|
-
return [];
|
|
953
|
-
}
|
|
954
1341
|
|
|
955
|
-
|
|
956
|
-
export function demoMailboxRules(mailboxId: string): Array<MailRuleInput & { id: string }> {
|
|
957
|
-
if (mailboxId !== "mbx_demo_personal") return [];
|
|
958
|
-
return [{
|
|
959
|
-
id: "rul_demo_hireline",
|
|
960
|
-
name: "Job alerts",
|
|
961
|
-
enabled: true,
|
|
962
|
-
conditions: { from: "@hireline.example" },
|
|
963
|
-
actions: { archive: true, markRead: true },
|
|
964
|
-
}];
|
|
1342
|
+
return [];
|
|
965
1343
|
}
|
|
966
1344
|
|
|
967
1345
|
/** Message ids whose report labels a demo login clears. */
|
|
968
1346
|
export function demoMailboxEmailIds(mailboxId: string) {
|
|
969
1347
|
return demoInputs(mailboxId).map((input) => input.id);
|
|
970
1348
|
}
|
|
971
|
-
|
|
972
|
-
/** A phishing report waiting in Administration → Reported messages. */
|
|
973
|
-
export const demoReportedMessage = {
|
|
974
|
-
id: "rpt_demo_quota",
|
|
975
|
-
mailboxId: "mbx_demo_support",
|
|
976
|
-
emailId: "msg_demo_20",
|
|
977
|
-
reportLabel: "phishing" as const,
|
|
978
|
-
};
|