This commit is contained in:
2025-05-21 12:52:24 +00:00
parent b0a0078ad0
commit 3f220996ee
14 changed files with 4773 additions and 197 deletions

View File

@ -140,6 +140,11 @@ export interface ISmtpSession {
* Timestamp of last activity for session timeout tracking
*/
lastActivity?: number;
/**
* Timeout ID for DATA command timeout
*/
dataTimeoutId?: NodeJS.Timeout;
}
/**
@ -186,11 +191,31 @@ export interface ISmtpServerOptions {
*/
hostname?: string;
/**
* Host address to bind to (defaults to all interfaces)
*/
host?: string;
/**
* Secure port for dedicated TLS connections
*/
securePort?: number;
/**
* CA certificates for TLS (PEM format)
*/
ca?: string;
/**
* Maximum size of messages in bytes
*/
maxSize?: number;
/**
* Maximum number of concurrent connections
*/
maxConnections?: number;
/**
* Authentication options
*/
@ -207,14 +232,37 @@ export interface ISmtpServerOptions {
};
/**
* Socket timeout in milliseconds (default: 5 minutes)
* Socket timeout in milliseconds (default: 5 minutes / 300000ms)
*/
socketTimeout?: number;
/**
* Initial connection timeout in milliseconds (default: 30 seconds)
* Initial connection timeout in milliseconds (default: 30 seconds / 30000ms)
*/
connectionTimeout?: number;
/**
* Interval for checking idle sessions in milliseconds (default: 5 seconds / 5000ms)
* For testing, can be set lower (e.g. 1000ms) to detect timeouts more quickly
*/
cleanupInterval?: number;
/**
* Maximum number of recipients allowed per message (default: 100)
*/
maxRecipients?: number;
/**
* Maximum message size in bytes (default: 10MB / 10485760 bytes)
* This is advertised in the EHLO SIZE extension
*/
size?: number;
/**
* Timeout for the DATA command in milliseconds (default: 60000ms / 1 minute)
* This controls how long to wait for the complete email data
*/
dataTimeout?: number;
}
/**