fix(mail/delivery): Centralize runtime/plugin imports and switch modules to use plugins exports; unify EventEmitter usage; update Deno dependencies and small path/server refactors

This commit is contained in:
2025-10-24 10:00:25 +00:00
parent d4778d15fc
commit 27b6bb779e
17 changed files with 87 additions and 62 deletions

View File

@@ -1,12 +1,11 @@
import * as plugins from '../../plugins.ts';
import { EventEmitter } from 'node:events';
import type { IEmailRoute, IEmailMatch, IEmailAction, IEmailContext } from './interfaces.ts';
import type { Email } from '../core/classes.email.ts';
/**
* Email router that evaluates routes and determines actions
*/
export class EmailRouter extends EventEmitter {
export class EmailRouter extends plugins.EventEmitter {
private routes: IEmailRoute[];
private patternCache: Map<string, boolean> = new Map();
private storageManager?: any; // StorageManager instance

View File

@@ -1,6 +1,5 @@
import * as plugins from '../../plugins.ts';
import * as paths from '../../paths.ts';
import { EventEmitter } from 'events';
import { logger } from '../../logger.ts';
import {
SecurityLogger,
@@ -154,7 +153,7 @@ export interface IServerStats {
/**
* Unified email server that handles all email traffic with pattern-based routing
*/
export class UnifiedEmailServer extends EventEmitter {
export class UnifiedEmailServer extends plugins.EventEmitter {
private dcRouter: DcRouter;
private options: IUnifiedEmailServerOptions;
private emailRouter: EmailRouter;