@serve.zone/dcrouter 18.1.0 → 18.2.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.
- package/deno.json +1 -1
- package/dist_serve/bundle.js +2072 -1624
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.dcrouter.d.ts +64 -2
- package/dist_ts/classes.dcrouter.js +187 -6
- package/dist_ts/db/documents/classes.authentication-event.doc.d.ts +25 -0
- package/dist_ts/db/documents/classes.authentication-event.doc.js +273 -0
- package/dist_ts/db/documents/classes.email-traffic-bucket.doc.d.ts +25 -0
- package/dist_ts/db/documents/classes.email-traffic-bucket.doc.js +200 -0
- package/dist_ts/db/documents/index.d.ts +2 -0
- package/dist_ts/db/documents/index.js +3 -1
- package/dist_ts/email/classes.accepted-email-spool.d.ts +67 -0
- package/dist_ts/email/classes.accepted-email-spool.js +245 -17
- package/dist_ts/email/classes.workapp-mail-manager.js +5 -2
- package/dist_ts/monitoring/classes.metricsmanager.d.ts +19 -0
- package/dist_ts/monitoring/classes.metricsmanager.js +240 -44
- package/dist_ts/opsserver/handlers/admin.handler.d.ts +1 -0
- package/dist_ts/opsserver/handlers/admin.handler.js +61 -14
- package/dist_ts/opsserver/handlers/security.handler.js +21 -3
- package/dist_ts/opsserver/handlers/stats.handler.js +27 -10
- package/dist_ts/security/classes.authentication-event-manager.d.ts +35 -0
- package/dist_ts/security/classes.authentication-event-manager.js +185 -0
- package/dist_ts/security/index.d.ts +1 -0
- package/dist_ts/security/index.js +2 -1
- package/dist_ts_interfaces/data/stats.d.ts +16 -0
- package/dist_ts_migrations/index.js +74 -15
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/overview/ops-view-overview.js +3 -2
- package/dist_ts_web/elements/security/ops-view-security-authentication.js +20 -13
- package/dist_ts_web/elements/security/ops-view-security-overview.js +8 -11
- package/package.json +3 -3
- package/readme.md +24 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.dcrouter.ts +230 -6
- package/ts/db/documents/classes.authentication-event.doc.ts +248 -0
- package/ts/db/documents/classes.email-traffic-bucket.doc.ts +161 -0
- package/ts/db/documents/index.ts +2 -0
- package/ts/email/classes.accepted-email-spool.ts +319 -21
- package/ts/email/classes.workapp-mail-manager.ts +4 -1
- package/ts/monitoring/classes.metricsmanager.ts +287 -50
- package/ts/opsserver/handlers/admin.handler.ts +74 -15
- package/ts/opsserver/handlers/security.handler.ts +23 -2
- package/ts/opsserver/handlers/stats.handler.ts +29 -9
- package/ts/security/classes.authentication-event-manager.ts +221 -0
- package/ts/security/index.ts +1 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/overview/ops-view-overview.ts +2 -1
- package/ts_web/elements/security/ops-view-security-authentication.ts +20 -13
- package/ts_web/elements/security/ops-view-security-overview.ts +7 -12
|
@@ -77,6 +77,27 @@ export declare class AcceptedEmailSpool {
|
|
|
77
77
|
private smtpTransactionListeners;
|
|
78
78
|
private emailQueuePersistedListeners;
|
|
79
79
|
constructor(dcRouterRef: DcRouter);
|
|
80
|
+
/**
|
|
81
|
+
* Direction is decided by the RECIPIENT, never by whether the session
|
|
82
|
+
* authenticated. Authentication grants permission to relay; it does not make
|
|
83
|
+
* a message addressed to a mailbox we host into outbound mail. A message with
|
|
84
|
+
* at least one locally hosted recipient is inbound — a local mailbox receives
|
|
85
|
+
* it — and only an envelope addressed exclusively to remote recipients is
|
|
86
|
+
* outbound.
|
|
87
|
+
*
|
|
88
|
+
* `IResolvedRecipientRoute.localDomain` is smartmta's own per-recipient
|
|
89
|
+
* verdict (non-null exactly when the domain registry hosts the domain), so
|
|
90
|
+
* the classification uses the same truth the routing decision used. When an
|
|
91
|
+
* acceptance context carries no resolution the envelope recipients are
|
|
92
|
+
* classified against the live registry instead — never against the session,
|
|
93
|
+
* which is the mistake being fixed.
|
|
94
|
+
*/
|
|
95
|
+
private deriveDirectionFromResolvedRoutes;
|
|
96
|
+
/**
|
|
97
|
+
* Recipient-derived direction for programmatic submitters, which have no SMTP
|
|
98
|
+
* recipient resolution to consult. Falls back to the live domain registry.
|
|
99
|
+
*/
|
|
100
|
+
private deriveDirectionFromRecipients;
|
|
80
101
|
acceptMessage(context: IMessageAcceptanceContext, processAfterAccept?: boolean): Promise<IMessageAcceptanceDecision>;
|
|
81
102
|
acceptRawMessage(optionsArg: IAcceptRawEmailOptions): Promise<IMessageAcceptanceDecision & {
|
|
82
103
|
spoolItemId: string;
|
|
@@ -88,6 +109,50 @@ export declare class AcceptedEmailSpool {
|
|
|
88
109
|
* exact-plan executor. Store recipients are fulfilled by the anchor itself.
|
|
89
110
|
*/
|
|
90
111
|
acceptEnvelope(context: IAcceptEnvelopeContext, emailServer: UnifiedEmailServer): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Session metadata for `dispatchAcceptedEnvelope`. It feeds the per-recipient
|
|
114
|
+
* idempotency fingerprint, so it must be JSON-round-trip stable: a replay
|
|
115
|
+
* reconstructed from persisted state has to produce byte-identical metadata
|
|
116
|
+
* or upstream refuses it as an idempotency-key reuse.
|
|
117
|
+
*/
|
|
118
|
+
private buildEnvelopeDispatchMetadata;
|
|
119
|
+
/**
|
|
120
|
+
* Dispatch (or redispatch) the non-store recipients of a durably accepted
|
|
121
|
+
* envelope.
|
|
122
|
+
*
|
|
123
|
+
* The raw bytes handed to upstream are the exact bytes persisted for this row,
|
|
124
|
+
* because upstream fingerprints every recipient over the raw message: a later
|
|
125
|
+
* replay with different bytes would be rejected as an idempotency-key reuse
|
|
126
|
+
* rather than retried. Recipients that already succeeded are short-circuited
|
|
127
|
+
* by upstream's checkpoints, and `failed` results are deliberately not
|
|
128
|
+
* checkpointed upstream, so an identical replay retries exactly those.
|
|
129
|
+
*
|
|
130
|
+
* A `failed` recipient leaves the row non-terminal so the spool retries it;
|
|
131
|
+
* a `rejected` recipient is a permanent per-recipient refusal and is recorded
|
|
132
|
+
* durably instead of being retried. Either way the outcome is persisted — a
|
|
133
|
+
* relay recipient is never silently dropped after the SMTP 250.
|
|
134
|
+
*/
|
|
135
|
+
private dispatchEnvelopeRecipients;
|
|
136
|
+
/**
|
|
137
|
+
* Persist a dispatch attempt's outcome on the durable-envelope row.
|
|
138
|
+
*
|
|
139
|
+
* The row's status tracks the stored envelope, not the relay: it goes
|
|
140
|
+
* `deferred` only while relay recipients still need a redispatch, and returns
|
|
141
|
+
* to its acceptance status once none do. Relay progress itself lives in
|
|
142
|
+
* `routeData.envelopeDispatch`, so a relay failure can never mark a row whose
|
|
143
|
+
* local copy stored successfully as failed.
|
|
144
|
+
*/
|
|
145
|
+
private persistEnvelopeDispatchOutcome;
|
|
146
|
+
/**
|
|
147
|
+
* Take exclusive ownership of a durably accepted envelope row in the spool.
|
|
148
|
+
*
|
|
149
|
+
* Runs before live-queue postponement and before the normal spool handoff: a
|
|
150
|
+
* relay sibling that did enqueue would otherwise postpone this row forever,
|
|
151
|
+
* and the normal handoff would re-run route evaluation and duplicate a
|
|
152
|
+
* delivery the stored copy already fulfilled.
|
|
153
|
+
*/
|
|
154
|
+
private handleDurableEnvelopeRow;
|
|
155
|
+
private trackAcceptedInboundEmail;
|
|
91
156
|
/**
|
|
92
157
|
* Synthesizes the inbound SMTP transaction for the email log from the
|
|
93
158
|
* acceptance context: the receiving session where WE are the server. The
|
|
@@ -131,6 +196,8 @@ export declare class AcceptedEmailSpool {
|
|
|
131
196
|
private clearSpoolTimer;
|
|
132
197
|
private setDcRouterCacheIdHeader;
|
|
133
198
|
private isCachedEmailTerminal;
|
|
199
|
+
/** Whether this row was durably accepted through the envelope acceptance path. */
|
|
200
|
+
private isDurableEnvelopeRow;
|
|
134
201
|
/** The CachedEmail row a live queue item was spooled from (via the cache-id header). */
|
|
135
202
|
getCachedEmailIdFromQueueItem(item: TSmartMtaQueueItemLike): string | undefined;
|
|
136
203
|
private postponeLiveSmartMtaOwnedEmail;
|