import { type MIMEBuildResult } from "../core/mime.js"; import type { SMTPResponse } from "../core/smtp.js"; import { encodeLine } from "../core/smtp.js"; import type { MailOptions, SendResult, SMTPConfig, SocketAdapter, Transport, VerifyResult } from "../core/types.js"; /** * SMTP transport orchestrating adapter, MIME builder, and protocol logic. */ export declare class SMTPTransport implements Transport { readonly provider = "smtp"; /** Resolved SMTP configuration with defaults applied. */ private readonly config; /** Active socket adapter for the current session, if any. */ private adapter; /** Creates an SMTP transport with the given configuration. */ constructor(config: SMTPConfig); /** Sends an email via SMTP using the configured adapter. */ send(options: MailOptions): Promise; /** Verifies SMTP connectivity and authentication without sending mail. */ verify(): Promise; /** Closes the underlying socket adapter if connected. */ close(): Promise; /** Returns the configured socket adapter or throws if none is set. */ private getAdapter; } /** Resolved SMTP transport configuration with defaults applied. */ export interface ResolvedSMTPConfig { /** SMTP server hostname. */ host: string; /** SMTP port with secure/default applied. */ port: number; /** Whether implicit TLS is used. */ secure: boolean; /** Resolved authentication credentials, if any. */ auth?: SMTPConfig["auth"]; /** Whether AUTH requires an encrypted connection. */ requireTLS?: boolean; /** TLS options for STARTTLS and direct TLS. */ tls?: SMTPConfig["tls"]; /** DKIM signing configuration. */ dkim?: SMTPConfig["dkim"]; /** Socket connect timeout in milliseconds. */ connectionTimeout?: number; /** Timeout waiting for the SMTP greeting in milliseconds. */ greetingTimeout?: number; /** Idle socket timeout in milliseconds. */ socketTimeout?: number; /** Direct-to-MX delivery mode. */ direct?: boolean; /** Runtime socket adapter. */ adapter?: SocketAdapter; } /** Apply defaults to SMTP configuration. */ export declare function resolveSMTPConfig(config: SMTPConfig): ResolvedSMTPConfig; /** * Connect greeting, EHLO, optional STARTTLS, and AUTH on an open adapter. */ export declare function openSMTPSession(adapter: SocketAdapter, config: ResolvedSMTPConfig): Promise; /** * MAIL FROM, RCPT TO, and DATA for a built MIME message on an authenticated session. */ export declare function deliverSMTPMessage(adapter: SocketAdapter, mime: MIMEBuildResult): Promise; /** * QUIT and close an SMTP session adapter. */ export declare function closeSMTPSession(adapter: SocketAdapter): Promise; /** Reads and parses a complete SMTP response from the adapter. */ declare function readSMTPResponse(adapter: SocketAdapter): Promise; export { SMTPError } from "../core/smtp.js"; /** @internal Test helper for raw line writes. */ export { encodeLine, readSMTPResponse };