@push.rocks/smartmta 5.3.3 → 6.0.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/changelog.md +23 -0
- package/dist_rust/mailer-bin_linux_amd64 +0 -0
- package/dist_rust/mailer-bin_linux_arm64 +0 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/mail/routing/classes.unified.email.server.d.ts +65 -0
- package/dist_ts/mail/routing/classes.unified.email.server.js +348 -40
- package/dist_ts/mail/routing/interfaces.d.ts +2 -0
- package/dist_ts/security/classes.rustsecuritybridge.d.ts +33 -1
- package/dist_ts/security/classes.rustsecuritybridge.js +18 -1
- package/package.json +12 -14
- package/readme.md +83 -30
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/mail/routing/classes.unified.email.server.ts +437 -39
- package/ts/mail/routing/interfaces.ts +3 -1
- package/ts/security/classes.rustsecuritybridge.ts +53 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-06-06 - 6.0.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- preserve custom parsed headers on buffered emails (routing)
|
|
8
|
+
- Store non-standard parsed headers on routed Email instances so queued processing results retain custom metadata.
|
|
9
|
+
- Exclude standard parsed fields such as subject from the preserved headers map.
|
|
10
|
+
- Add e2e coverage for retaining the cached email header during buffer processing.
|
|
11
|
+
|
|
12
|
+
## 2026-06-06 - 6.0.0
|
|
13
|
+
|
|
14
|
+
### Breaking Changes
|
|
15
|
+
|
|
16
|
+
- enforce recipient validation and explicit relay permissions (smtp)
|
|
17
|
+
- enable RCPT TO validation by default and require explicit `allowRelay` route permission for non-local recipients.
|
|
18
|
+
- add awaited recipient and message acceptance callbacks so SMTP success is returned only after policy and consumer acceptance.
|
|
19
|
+
- add trusted PROXY protocol v1 support for backend listeners and fail closed when trusted peers are not configured.
|
|
20
|
+
- harden Rust SMTP shutdown, callback cleanup, temp-file cleanup, and bridge handler lifecycle.
|
|
21
|
+
- restrict npm platform metadata to the Linux targets built and published by the Rust release pipeline.
|
|
22
|
+
- migrate release configuration to current target-based GitZone release metadata.
|
|
23
|
+
- remove stale Deno-era Gitea workflows and release metadata that targeted the legacy `serve.zone/mailer` project.
|
|
24
|
+
- update SMTP relay policy documentation and contract coverage.
|
|
25
|
+
|
|
3
26
|
## 2026-04-14 - 5.3.3 - fix(build)
|
|
4
27
|
migrate project config to .smartconfig.json and refresh package dependencies
|
|
5
28
|
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartmta',
|
|
6
|
-
version: '
|
|
6
|
+
version: '6.0.1',
|
|
7
7
|
description: 'A high-performance, enterprise-grade Mail Transfer Agent (MTA) built from scratch in TypeScript with Rust acceleration.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHlIQUF5SDtDQUN2SSxDQUFBIn0=
|
|
@@ -25,6 +25,33 @@ export interface IExtendedSmtpSession extends ISmtpSession {
|
|
|
25
25
|
*/
|
|
26
26
|
matchedRoute?: IEmailRoute;
|
|
27
27
|
}
|
|
28
|
+
export interface ISmtpDecision {
|
|
29
|
+
accepted: boolean;
|
|
30
|
+
smtpCode?: number;
|
|
31
|
+
smtpMessage?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IRcptToPolicyContext {
|
|
34
|
+
sessionId: string;
|
|
35
|
+
mailFrom: string;
|
|
36
|
+
rcptTo: string;
|
|
37
|
+
acceptedRcptTo: string[];
|
|
38
|
+
remoteAddress: string;
|
|
39
|
+
clientHostname: string | null;
|
|
40
|
+
secure: boolean;
|
|
41
|
+
authenticated: boolean;
|
|
42
|
+
authenticatedUser: string | null;
|
|
43
|
+
abortSignal?: AbortSignal;
|
|
44
|
+
}
|
|
45
|
+
export interface IMessageAcceptanceContext {
|
|
46
|
+
email: Email;
|
|
47
|
+
rawMessage: Buffer;
|
|
48
|
+
session: IExtendedSmtpSession;
|
|
49
|
+
abortSignal?: AbortSignal;
|
|
50
|
+
}
|
|
51
|
+
export interface IMessageAcceptanceDecision extends ISmtpDecision {
|
|
52
|
+
/** Continue SmartMTA's built-in route processing after the consumer accepted responsibility. */
|
|
53
|
+
continueProcessing?: boolean;
|
|
54
|
+
}
|
|
28
55
|
/**
|
|
29
56
|
* Options for the unified email server
|
|
30
57
|
*/
|
|
@@ -59,6 +86,25 @@ export interface IUnifiedEmailServerOptions {
|
|
|
59
86
|
connectionTimeout?: number;
|
|
60
87
|
socketTimeout?: number;
|
|
61
88
|
routes: IEmailRoute[];
|
|
89
|
+
smtp?: {
|
|
90
|
+
/** Enable route/hook based RCPT TO validation before DATA. Defaults to true; set false only for fully trusted private listeners. */
|
|
91
|
+
recipientValidation?: boolean;
|
|
92
|
+
/** Timeout for RCPT policy callbacks. Defaults to 5000 ms. */
|
|
93
|
+
recipientValidationTimeoutMs?: number;
|
|
94
|
+
/** Timeout for message acceptance callbacks. Defaults to 30000 ms. */
|
|
95
|
+
messageAcceptanceTimeoutMs?: number;
|
|
96
|
+
/** Require trusted PROXY v1 from the backend proxy before SMTP greeting. */
|
|
97
|
+
proxyProtocol?: {
|
|
98
|
+
required?: boolean;
|
|
99
|
+
trustedIps?: string[];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
hooks?: {
|
|
103
|
+
/** Async recipient policy hook, called before each RCPT TO is accepted. */
|
|
104
|
+
onRcptTo?: (context: IRcptToPolicyContext) => Promise<ISmtpDecision>;
|
|
105
|
+
/** Async message acceptance hook, called after DATA before the final SMTP response. */
|
|
106
|
+
onMessageData?: (context: IMessageAcceptanceContext) => Promise<IMessageAcceptanceDecision>;
|
|
107
|
+
};
|
|
62
108
|
defaults?: {
|
|
63
109
|
dnsMode?: 'forward' | 'internal-dns' | 'external-dns';
|
|
64
110
|
dkim?: IEmailDomainConfig['dkim'];
|
|
@@ -135,6 +181,11 @@ export declare class UnifiedEmailServer extends EventEmitter {
|
|
|
135
181
|
private rateLimiter;
|
|
136
182
|
private actionExecutor;
|
|
137
183
|
private dkimManager;
|
|
184
|
+
private bridgeStateChangeHandler?;
|
|
185
|
+
private bridgeRcptToRequestHandler?;
|
|
186
|
+
private bridgeEmailReceivedHandler?;
|
|
187
|
+
private bridgeAuthRequestHandler?;
|
|
188
|
+
private bridgeScramCredentialRequestHandler?;
|
|
138
189
|
constructor(dcRouter: DcRouter, options: IUnifiedEmailServerOptions);
|
|
139
190
|
private getAdvertisedHostname;
|
|
140
191
|
private getOutboundHostname;
|
|
@@ -159,15 +210,29 @@ export declare class UnifiedEmailServer extends EventEmitter {
|
|
|
159
210
|
private startRustBridge;
|
|
160
211
|
private initializeDkimAndDns;
|
|
161
212
|
private registerBridgeEventHandlers;
|
|
213
|
+
private unregisterBridgeStateHandler;
|
|
214
|
+
private unregisterBridgeEventHandlers;
|
|
162
215
|
private startSmtpServer;
|
|
163
216
|
/**
|
|
164
217
|
* Stop the unified email server
|
|
165
218
|
*/
|
|
166
219
|
stop(): Promise<void>;
|
|
220
|
+
private handleRustRcptToRequest;
|
|
221
|
+
private evaluateDefaultRcptToPolicy;
|
|
222
|
+
private enforceAcceptedRcptToRelayPolicy;
|
|
223
|
+
private buildPolicySession;
|
|
224
|
+
private getAddressDomain;
|
|
225
|
+
private getRecipientValidationTimeoutMs;
|
|
226
|
+
private isRecipientValidationEnabled;
|
|
227
|
+
private getMessageAcceptanceTimeoutMs;
|
|
228
|
+
private runHookWithTimeout;
|
|
167
229
|
/**
|
|
168
230
|
* Handle an emailReceived event from the Rust SMTP server.
|
|
169
231
|
*/
|
|
170
232
|
private handleRustEmailReceived;
|
|
233
|
+
private createEmailFromBuffer;
|
|
234
|
+
private isStandardParsedHeader;
|
|
235
|
+
private stringifyParsedHeaderValue;
|
|
171
236
|
/**
|
|
172
237
|
* Handle an authRequest event from the Rust SMTP server.
|
|
173
238
|
*/
|