feat(structure): Use unified Email class
This commit is contained in:
@ -3,6 +3,7 @@ import * as paths from '../../paths.js';
|
||||
import { logger } from '../../logger.js';
|
||||
import { SecurityLogger, SecurityLogLevel, SecurityEventType } from '../../security/index.js';
|
||||
import { LRUCache } from 'lru-cache';
|
||||
import type { Email } from './classes.email.js';
|
||||
|
||||
/**
|
||||
* Bounce types for categorizing the reasons for bounces
|
||||
@ -380,7 +381,7 @@ export class BounceManager {
|
||||
* @param bounceEmail The email containing bounce information
|
||||
* @returns Processed bounce record or null if not a bounce
|
||||
*/
|
||||
public async processBounceEmail(bounceEmail: plugins.smartmail.Smartmail<any>): Promise<BounceRecord | null> {
|
||||
public async processBounceEmail(bounceEmail: Email): Promise<BounceRecord | null> {
|
||||
try {
|
||||
// Check if this is a bounce notification
|
||||
const subject = bounceEmail.getSubject();
|
||||
@ -435,7 +436,7 @@ export class BounceManager {
|
||||
if (!recipient) {
|
||||
logger.log('warn', 'Could not extract recipient from bounce notification', {
|
||||
subject,
|
||||
sender: bounceEmail.options.from
|
||||
sender: bounceEmail.from
|
||||
});
|
||||
return null;
|
||||
}
|
||||
@ -449,7 +450,7 @@ export class BounceManager {
|
||||
// Create bounce data
|
||||
const bounceData: Partial<BounceRecord> = {
|
||||
recipient,
|
||||
sender: bounceEmail.options.from,
|
||||
sender: bounceEmail.from,
|
||||
domain: recipient.split('@')[1],
|
||||
subject: bounceEmail.getSubject(),
|
||||
diagnosticCode,
|
||||
|
Reference in New Issue
Block a user