31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
/**
|
|
* SMTP Server Creation Factory
|
|
* Provides a simple way to create a complete SMTP server
|
|
*/
|
|
|
|
import { SmtpServer } from './smtp-server.js';
|
|
import { SessionManager } from './session-manager.js';
|
|
import { ConnectionManager } from './connection-manager.js';
|
|
import { CommandHandler } from './command-handler.js';
|
|
import { DataHandler } from './data-handler.js';
|
|
import { TlsHandler } from './tls-handler.js';
|
|
import { SecurityHandler } from './security-handler.js';
|
|
import type { ISmtpServerOptions } from './interfaces.js';
|
|
import { UnifiedEmailServer } from '../../routing/classes.unified.email.server.js';
|
|
|
|
/**
|
|
* Create a complete SMTP server with all components
|
|
* @param emailServer - Email server reference
|
|
* @param options - SMTP server options
|
|
* @returns Configured SMTP server instance
|
|
*/
|
|
export function createSmtpServer(emailServer: UnifiedEmailServer, options: ISmtpServerOptions): SmtpServer {
|
|
// First create the SMTP server instance
|
|
const smtpServer = new SmtpServer({
|
|
emailServer,
|
|
options
|
|
});
|
|
|
|
// Return the configured server
|
|
return smtpServer;
|
|
} |