feat: Add comprehensive SMTP test suite for Deno

- Implemented SMTP client utilities in `test/helpers/smtp.client.ts` for creating test clients, sending emails, and testing connections.
- Developed SMTP protocol test utilities in `test/helpers/utils.ts` for managing TCP connections, sending commands, and handling responses.
- Created a detailed README in `test/readme.md` outlining the test framework, infrastructure, organization, and running instructions.
- Ported CMD-01: EHLO Command tests in `test/suite/smtpserver_commands/test.cmd-01.ehlo-command.test.ts` with multiple scenarios including valid and invalid hostnames.
- Ported CMD-02: MAIL FROM Command tests in `test/suite/smtpserver_commands/test.cmd-02.mail-from.test.ts` covering valid address acceptance, invalid address rejection, SIZE parameter support, and command sequence enforcement.
This commit is contained in:
2025-10-25 15:05:11 +00:00
parent d7f37afc30
commit 1698df3a53
12 changed files with 1668 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ export * as path from '@std/path';
export * as colors from '@std/fmt/colors';
export * as cli from '@std/cli';
export { serveDir } from '@std/http/file-server';
export * as crypto from '@std/crypto';
export * as denoCrypto from '@std/crypto';
// Node.js built-in modules (needed for SMTP and email processing)
import { EventEmitter } from 'node:events';
@@ -20,8 +20,9 @@ import * as os from 'node:os';
import * as process from 'node:process';
import * as buffer from 'node:buffer';
import * as util from 'node:util';
import * as crypto from 'node:crypto';
export { EventEmitter, net, tls, dns, fs, os, process, buffer, util };
export { EventEmitter, net, tls, dns, fs, os, process, buffer, util, crypto };
export const Buffer = buffer.Buffer;
// Cloudflare API client

View File

@@ -10,7 +10,7 @@ export interface IIpReputationResult {
sources: string[];
}
export class IpReputationChecker {
export class IPReputationChecker {
public async checkReputation(ip: string): Promise<IIpReputationResult> {
// Placeholder implementation
return {