BREAKING CHANGE(mta): migrate internal MTA to @push.rocks/smartmta and remove legacy mail/deliverability implementation
This commit is contained in:
@@ -177,34 +177,28 @@ export class EmailOpsHandler {
|
||||
async (dataArg) => {
|
||||
const emailServer = this.opsServerRef.dcRouterRef.emailServer;
|
||||
|
||||
// Get bounce manager from email server via reflection
|
||||
// BounceManager is private but we need to access it
|
||||
const bounceManager = (emailServer as any)?.bounceManager;
|
||||
|
||||
if (!bounceManager) {
|
||||
if (!emailServer) {
|
||||
return { records: [], suppressionList: [], total: 0 };
|
||||
}
|
||||
|
||||
// Get suppression list
|
||||
const suppressionList = bounceManager.getSuppressionList();
|
||||
|
||||
// Get hard bounced addresses and convert to records
|
||||
const hardBouncedAddresses = bounceManager.getHardBouncedAddresses();
|
||||
// Use smartmta's public API for bounce/suppression data
|
||||
const suppressionList = emailServer.getSuppressionList();
|
||||
const hardBouncedAddresses = emailServer.getHardBouncedAddresses();
|
||||
|
||||
// Create bounce records from the available data
|
||||
const records: interfaces.requests.IBounceRecord[] = [];
|
||||
|
||||
for (const email of hardBouncedAddresses) {
|
||||
const bounceInfo = bounceManager.getBounceInfo(email);
|
||||
const bounceInfo = emailServer.getBounceHistory(email);
|
||||
if (bounceInfo) {
|
||||
records.push({
|
||||
id: `bounce-${email}`,
|
||||
recipient: email,
|
||||
sender: '',
|
||||
domain: email.split('@')[1] || '',
|
||||
bounceType: bounceInfo.type as interfaces.requests.TBounceType,
|
||||
bounceCategory: bounceInfo.category as interfaces.requests.TBounceCategory,
|
||||
timestamp: bounceInfo.lastBounce,
|
||||
bounceType: (bounceInfo as any).type as interfaces.requests.TBounceType,
|
||||
bounceCategory: (bounceInfo as any).category as interfaces.requests.TBounceCategory,
|
||||
timestamp: (bounceInfo as any).lastBounce,
|
||||
processed: true,
|
||||
});
|
||||
}
|
||||
@@ -230,14 +224,13 @@ export class EmailOpsHandler {
|
||||
'removeFromSuppressionList',
|
||||
async (dataArg) => {
|
||||
const emailServer = this.opsServerRef.dcRouterRef.emailServer;
|
||||
const bounceManager = (emailServer as any)?.bounceManager;
|
||||
|
||||
if (!bounceManager) {
|
||||
return { success: false, error: 'Bounce manager not available' };
|
||||
if (!emailServer) {
|
||||
return { success: false, error: 'Email server not available' };
|
||||
}
|
||||
|
||||
try {
|
||||
bounceManager.removeFromSuppressionList(dataArg.email);
|
||||
emailServer.removeFromSuppressionList(dataArg.email);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user