@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
|
@@ -158,6 +158,12 @@ interface ISmtpServerConfig {
|
|
|
158
158
|
maxAuthFailures?: number;
|
|
159
159
|
socketTimeoutSecs?: number;
|
|
160
160
|
processingTimeoutSecs?: number;
|
|
161
|
+
recipientValidationEnabled?: boolean;
|
|
162
|
+
recipientValidationTimeoutSecs?: number;
|
|
163
|
+
proxyProtocol?: {
|
|
164
|
+
required?: boolean;
|
|
165
|
+
trustedIps?: string[];
|
|
166
|
+
};
|
|
161
167
|
rateLimits?: IRateLimitConfig;
|
|
162
168
|
}
|
|
163
169
|
|
|
@@ -187,6 +193,18 @@ interface IEmailReceivedEvent {
|
|
|
187
193
|
securityResults: any | null;
|
|
188
194
|
}
|
|
189
195
|
|
|
196
|
+
interface IRcptToRequestEvent {
|
|
197
|
+
correlationId: string;
|
|
198
|
+
sessionId: string;
|
|
199
|
+
mailFrom: string;
|
|
200
|
+
rcptTo: string;
|
|
201
|
+
acceptedRcptTo: string[];
|
|
202
|
+
remoteAddr: string;
|
|
203
|
+
clientHostname: string | null;
|
|
204
|
+
secure: boolean;
|
|
205
|
+
authenticatedUser: string | null;
|
|
206
|
+
}
|
|
207
|
+
|
|
190
208
|
interface IAuthRequestEvent {
|
|
191
209
|
correlationId: string;
|
|
192
210
|
sessionId: string;
|
|
@@ -274,6 +292,15 @@ type TMailerCommands = {
|
|
|
274
292
|
};
|
|
275
293
|
result: { resolved: boolean };
|
|
276
294
|
};
|
|
295
|
+
rcptToResult: {
|
|
296
|
+
params: {
|
|
297
|
+
correlationId: string;
|
|
298
|
+
accepted: boolean;
|
|
299
|
+
smtpCode?: number;
|
|
300
|
+
smtpMessage?: string;
|
|
301
|
+
};
|
|
302
|
+
result: { resolved: boolean };
|
|
303
|
+
};
|
|
277
304
|
authResult: {
|
|
278
305
|
params: {
|
|
279
306
|
correlationId: string;
|
|
@@ -859,6 +886,19 @@ export class RustSecurityBridge extends EventEmitter {
|
|
|
859
886
|
await this.bridge.sendCommand('emailProcessingResult', opts);
|
|
860
887
|
}
|
|
861
888
|
|
|
889
|
+
/**
|
|
890
|
+
* Send the result of recipient policy validation back to the Rust SMTP server.
|
|
891
|
+
*/
|
|
892
|
+
public async sendRcptToResult(opts: {
|
|
893
|
+
correlationId: string;
|
|
894
|
+
accepted: boolean;
|
|
895
|
+
smtpCode?: number;
|
|
896
|
+
smtpMessage?: string;
|
|
897
|
+
}): Promise<void> {
|
|
898
|
+
this.ensureRunning();
|
|
899
|
+
await this.bridge.sendCommand('rcptToResult', opts);
|
|
900
|
+
}
|
|
901
|
+
|
|
862
902
|
/**
|
|
863
903
|
* Send the result of authentication validation back to the Rust SMTP server.
|
|
864
904
|
*/
|
|
@@ -905,6 +945,13 @@ export class RustSecurityBridge extends EventEmitter {
|
|
|
905
945
|
this.bridge.on('management:emailReceived', handler);
|
|
906
946
|
}
|
|
907
947
|
|
|
948
|
+
/**
|
|
949
|
+
* Register a handler for RCPT TO policy requests from the Rust SMTP server.
|
|
950
|
+
*/
|
|
951
|
+
public onRcptToRequest(handler: (data: IRcptToRequestEvent) => void): void {
|
|
952
|
+
this.bridge.on('management:rcptToRequest', handler);
|
|
953
|
+
}
|
|
954
|
+
|
|
908
955
|
/**
|
|
909
956
|
* Register a handler for authRequest events from the Rust SMTP server.
|
|
910
957
|
* The handler must call sendAuthResult() with the correlationId.
|
|
@@ -926,6 +973,11 @@ export class RustSecurityBridge extends EventEmitter {
|
|
|
926
973
|
this.bridge.off('management:emailReceived', handler);
|
|
927
974
|
}
|
|
928
975
|
|
|
976
|
+
/** Remove an RCPT TO policy request handler. */
|
|
977
|
+
public offRcptToRequest(handler: (data: IRcptToRequestEvent) => void): void {
|
|
978
|
+
this.bridge.off('management:rcptToRequest', handler);
|
|
979
|
+
}
|
|
980
|
+
|
|
929
981
|
/** Remove an authRequest event handler. */
|
|
930
982
|
public offAuthRequest(handler: (data: IAuthRequestEvent) => void): void {
|
|
931
983
|
this.bridge.off('management:authRequest', handler);
|
|
@@ -952,6 +1004,7 @@ export type {
|
|
|
952
1004
|
IRateLimitConfig,
|
|
953
1005
|
IEmailData,
|
|
954
1006
|
IEmailReceivedEvent,
|
|
1007
|
+
IRcptToRequestEvent,
|
|
955
1008
|
IAuthRequestEvent,
|
|
956
1009
|
IScramCredentialRequestEvent,
|
|
957
1010
|
IOutboundEmail,
|