@push.rocks/smartmta 5.3.1 → 6.0.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/changelog.md +29 -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/core/classes.bouncemanager.d.ts +2 -1
- package/dist_ts/mail/core/classes.bouncemanager.js +6 -5
- package/dist_ts/mail/delivery/classes.delivery.queue.d.ts +3 -2
- package/dist_ts/mail/delivery/classes.delivery.queue.js +4 -1
- package/dist_ts/mail/index.d.ts +1 -0
- package/dist_ts/mail/index.js +2 -1
- package/dist_ts/mail/interfaces.storage.d.ts +7 -0
- package/dist_ts/mail/interfaces.storage.js +4 -0
- package/dist_ts/mail/routing/classes.dkim.manager.d.ts +2 -1
- package/dist_ts/mail/routing/classes.dkim.manager.js +17 -8
- package/dist_ts/mail/routing/classes.dns.manager.d.ts +1 -5
- package/dist_ts/mail/routing/classes.dns.manager.js +2 -2
- package/dist_ts/mail/routing/classes.email.router.d.ts +2 -1
- package/dist_ts/mail/routing/classes.email.router.js +6 -5
- package/dist_ts/mail/routing/classes.unified.email.server.d.ts +80 -3
- package/dist_ts/mail/routing/classes.unified.email.server.js +339 -47
- package/dist_ts/mail/routing/interfaces.d.ts +2 -0
- package/dist_ts/mail/security/classes.dkimcreator.d.ts +10 -5
- package/dist_ts/mail/security/classes.dkimcreator.js +91 -70
- package/dist_ts/security/classes.ipreputationchecker.d.ts +4 -3
- package/dist_ts/security/classes.ipreputationchecker.js +4 -3
- package/dist_ts/security/classes.rustsecuritybridge.d.ts +33 -1
- package/dist_ts/security/classes.rustsecuritybridge.js +18 -1
- package/package.json +19 -21
- package/readme.hints.md +1 -1
- package/readme.md +100 -30
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/mail/core/classes.bouncemanager.ts +7 -6
- package/ts/mail/delivery/classes.delivery.queue.ts +7 -3
- package/ts/mail/index.ts +2 -1
- package/ts/mail/interfaces.storage.ts +13 -0
- package/ts/mail/routing/classes.dkim.manager.ts +24 -11
- package/ts/mail/routing/classes.dns.manager.ts +3 -8
- package/ts/mail/routing/classes.email.router.ts +7 -6
- package/ts/mail/routing/classes.unified.email.server.ts +446 -50
- package/ts/mail/routing/interfaces.ts +3 -1
- package/ts/mail/security/classes.dkimcreator.ts +115 -91
- package/ts/security/classes.ipreputationchecker.ts +7 -6
- package/ts/security/classes.rustsecuritybridge.ts +53 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as plugins from '../../plugins.js';
|
|
2
2
|
import type { IEmailDomainConfig } from './interfaces.js';
|
|
3
|
+
import type { IStorageManagerLike } from '../interfaces.storage.js';
|
|
3
4
|
import { logger } from '../../logger.js';
|
|
4
5
|
/** External DcRouter interface shape used by DnsManager */
|
|
5
6
|
interface IDcRouterLike {
|
|
@@ -8,12 +9,6 @@ interface IDcRouterLike {
|
|
|
8
9
|
options?: { dnsNsDomains?: string[]; dnsScopes?: string[] };
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
/** External StorageManager interface shape used by DnsManager */
|
|
12
|
-
interface IStorageManagerLike {
|
|
13
|
-
get(key: string): Promise<string | null>;
|
|
14
|
-
set(key: string, value: string): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
12
|
/**
|
|
18
13
|
* DNS validation result
|
|
19
14
|
*/
|
|
@@ -528,7 +523,7 @@ export class DnsManager {
|
|
|
528
523
|
|
|
529
524
|
try {
|
|
530
525
|
// Get DKIM DNS record from DKIMCreator
|
|
531
|
-
const dnsRecord = await dkimCreator.getDNSRecordForDomain(domain);
|
|
526
|
+
const dnsRecord = await dkimCreator.getDNSRecordForDomain(domain, selector);
|
|
532
527
|
|
|
533
528
|
// For internal-dns domains, register the DNS handler
|
|
534
529
|
if (domainConfig.dnsMode === 'internal-dns' && this.dcRouter.dnsServer) {
|
|
@@ -570,4 +565,4 @@ export class DnsManager {
|
|
|
570
565
|
}
|
|
571
566
|
}
|
|
572
567
|
}
|
|
573
|
-
}
|
|
568
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as plugins from '../../plugins.js';
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
|
+
import { hasStorageManagerMethods, type IStorageManagerLike } from '../interfaces.storage.js';
|
|
3
4
|
import type { IEmailRoute, IEmailMatch, IEmailAction, IEmailContext } from './interfaces.js';
|
|
4
5
|
import type { Email } from '../core/classes.email.js';
|
|
5
6
|
|
|
@@ -9,7 +10,7 @@ import type { Email } from '../core/classes.email.js';
|
|
|
9
10
|
export class EmailRouter extends EventEmitter {
|
|
10
11
|
private routes: IEmailRoute[];
|
|
11
12
|
private patternCache: Map<string, boolean> = new Map();
|
|
12
|
-
private storageManager?:
|
|
13
|
+
private storageManager?: IStorageManagerLike;
|
|
13
14
|
private persistChanges: boolean;
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -18,7 +19,7 @@ export class EmailRouter extends EventEmitter {
|
|
|
18
19
|
* @param options Router options
|
|
19
20
|
*/
|
|
20
21
|
constructor(routes: IEmailRoute[], options?: {
|
|
21
|
-
storageManager?:
|
|
22
|
+
storageManager?: IStorageManagerLike;
|
|
22
23
|
persistChanges?: boolean;
|
|
23
24
|
}) {
|
|
24
25
|
super();
|
|
@@ -27,7 +28,7 @@ export class EmailRouter extends EventEmitter {
|
|
|
27
28
|
this.persistChanges = options?.persistChanges ?? !!this.storageManager;
|
|
28
29
|
|
|
29
30
|
// If storage manager is provided, try to load persisted routes
|
|
30
|
-
if (this.storageManager) {
|
|
31
|
+
if (hasStorageManagerMethods(this.storageManager, ['get'])) {
|
|
31
32
|
this.loadRoutes({ merge: true }).catch(error => {
|
|
32
33
|
console.error(`Failed to load persisted routes: ${error.message}`);
|
|
33
34
|
});
|
|
@@ -394,7 +395,7 @@ export class EmailRouter extends EventEmitter {
|
|
|
394
395
|
* Save current routes to storage
|
|
395
396
|
*/
|
|
396
397
|
public async saveRoutes(): Promise<void> {
|
|
397
|
-
if (!this.storageManager) {
|
|
398
|
+
if (!hasStorageManagerMethods(this.storageManager, ['set'])) {
|
|
398
399
|
this.emit('persistenceWarning', 'Cannot save routes: StorageManager not configured');
|
|
399
400
|
return;
|
|
400
401
|
}
|
|
@@ -425,7 +426,7 @@ export class EmailRouter extends EventEmitter {
|
|
|
425
426
|
merge?: boolean; // Merge with existing routes
|
|
426
427
|
replace?: boolean; // Replace existing routes
|
|
427
428
|
}): Promise<IEmailRoute[]> {
|
|
428
|
-
if (!this.storageManager) {
|
|
429
|
+
if (!hasStorageManagerMethods(this.storageManager, ['get'])) {
|
|
429
430
|
this.emit('persistenceWarning', 'Cannot load routes: StorageManager not configured');
|
|
430
431
|
return [];
|
|
431
432
|
}
|
|
@@ -572,4 +573,4 @@ export class EmailRouter extends EventEmitter {
|
|
|
572
573
|
public getRoute(name: string): IEmailRoute | undefined {
|
|
573
574
|
return this.routes.find(r => r.name === name);
|
|
574
575
|
}
|
|
575
|
-
}
|
|
576
|
+
}
|