diff --git a/test/helpers/server.loader.ts b/test/helpers/server.loader.ts index 8b95012..941d489 100644 --- a/test/helpers/server.loader.ts +++ b/test/helpers/server.loader.ts @@ -46,6 +46,20 @@ export async function startTestServer(config: ITestServerConfig): Promise { console.log(`📧 [Test Server] Processing email:`, emailData.subject || 'No subject'); return emailData; + }, + getRateLimiter: () => { + // Return a mock rate limiter for testing + return { + recordConnection: (_ip: string) => ({ allowed: true, remaining: 100 }), + checkConnectionLimit: async (_ip: string) => ({ allowed: true, remaining: 100 }), + checkMessageLimit: (_senderAddress: string, _ip: string, _recipientCount?: number, _pattern?: string, _domain?: string) => ({ allowed: true, remaining: 1000 }), + checkRecipientLimit: async (_session: any) => ({ allowed: true, remaining: 50 }), + recordAuthenticationFailure: async (_ip: string) => {}, + recordSyntaxError: async (_ip: string) => {}, + recordCommandError: async (_ip: string) => {}, + isBlocked: async (_ip: string) => false, + cleanup: async () => {} + }; } } as any; @@ -131,14 +145,14 @@ export async function startTestServer(config: ITestServerConfig): Promise { // Test server accepts these credentials return username === 'testuser' && password === 'testpass'; } - } : undefined + } as any) : undefined }; // Create SMTP server