This commit is contained in:
2025-05-07 14:33:20 +00:00
parent 5ad43470f3
commit 2ee66ef967
14 changed files with 578 additions and 547 deletions

View File

@ -168,6 +168,9 @@ export class MtaService {
/** Whether the service is currently running */
private running = false;
/** SMTP rule engine for incoming emails */
public smtpRuleEngine: plugins.smartrule.SmartRule<Email>;
/**
* Initialize the MTA service
@ -188,6 +191,8 @@ export class MtaService {
this.dkimVerifier = new DKIMVerifier(this);
this.dnsManager = new DNSManager(this);
this.apiManager = new ApiManager();
// Initialize SMTP rule engine
this.smtpRuleEngine = new plugins.smartrule.SmartRule<Email>();
// Initialize stats
this.stats = {
@ -408,6 +413,12 @@ export class MtaService {
throw new Error('MTA service is not running');
}
// Apply SMTP rule engine decisions
try {
await this.smtpRuleEngine.makeDecision(email);
} catch (err) {
console.error('Error executing SMTP rules:', err);
}
try {
console.log(`Processing incoming email from ${email.from} to ${email.to}`);