update
This commit is contained in:
@ -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}`);
|
||||
|
||||
|
Reference in New Issue
Block a user