feat(structure): Use unified Email class

This commit is contained in:
2025-05-27 15:38:34 +00:00
parent cfea44742a
commit 243a45d24c
11 changed files with 546 additions and 143 deletions

View File

@ -1160,17 +1160,8 @@ export class UnifiedEmailServer extends EventEmitter {
logger.log('info', 'Processing potential bounce notification email');
try {
// Convert Email to Smartmail format for bounce processing
const smartmailEmail = new plugins.smartmail.Smartmail({
from: bounceEmail.from,
to: [bounceEmail.to[0]], // Ensure to is an array with at least one recipient
subject: bounceEmail.subject,
body: bounceEmail.text, // Smartmail uses 'body' instead of 'text'
htmlBody: bounceEmail.html // Smartmail uses 'htmlBody' instead of 'html'
});
// Process as a bounce notification
const bounceRecord = await this.bounceManager.processBounceEmail(smartmailEmail);
// Process as a bounce notification (no conversion needed anymore)
const bounceRecord = await this.bounceManager.processBounceEmail(bounceEmail);
if (bounceRecord) {
logger.log('info', `Successfully processed bounce notification for ${bounceRecord.recipient}`, {