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

@ -301,7 +301,7 @@ export class SMTPServer {
this.sessions.delete(socket);
}
private processEmailData(socket: plugins.net.Socket | plugins.tls.TLSSocket, data: string): void {
private async processEmailData(socket: plugins.net.Socket | plugins.tls.TLSSocket, data: string): Promise<void> {
const session = this.sessions.get(socket);
if (!session) return;
@ -384,8 +384,12 @@ export class SMTPServer {
mightBeSpam: email.mightBeSpam
});
// Process or forward the email as needed
// this.mtaRef.processIncomingEmail(email); // You could add this method to your MTA service
// Process or forward the email via MTA service
try {
await this.mtaRef.processIncomingEmail(email);
} catch (err) {
console.error('Error in MTA processing of incoming email:', err);
}
} catch (error) {
console.error('Error parsing email:', error);
}