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.ts';
 | |
| import { SessionManager } from './session-manager.ts';
 | |
| import { ConnectionManager } from './connection-manager.ts';
 | |
| import { CommandHandler } from './command-handler.ts';
 | |
| import { DataHandler } from './data-handler.ts';
 | |
| import { TlsHandler } from './tls-handler.ts';
 | |
| import { SecurityHandler } from './security-handler.ts';
 | |
| import type { ISmtpServerOptions } from './interfaces.ts';
 | |
| import { UnifiedEmailServer } from '../../routing/classes.unified.email.server.ts';
 | |
| 
 | |
| /**
 | |
|  * 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;
 | |
| } |