/** * The machine half of the email service. * * Everything else in this module is protocol and policy over an injected * socket, so the IMAP client, the SMTP client and the whole service run in a * test against an in-process fake server with no TLS and no real host. That * property is only worth anything if the connecting code lives somewhere * separate, and this is that somewhere: three socket factories, each the ONLY * place a real connection is opened. * * - `createImapTlsSocket` IMAP over implicit TLS (port 993) * - `createImapPlainSocket` IMAP unencrypted (port 143), for a localhost or * test server, `surfaces.email.imap.secure: false` * - `createSmtpTlsSocket` SMTP submission over implicit TLS (port 465) * - `createSmtpStartTlsSocket` SMTP submission, plain then STARTTLS (port 587) * * `nodeEmailTransport` bundles them into the `EmailTransportPort` the service * asks for. * * This entry is deliberately NOT re-exported from the module index: importing * the email service must never drag `node:tls` in behind it. A consumer asks * for these by name, from here. */ import type { Socket } from 'node:net'; import type { EmailTransportPort } from './email-service.js'; /** * Creates a TLS socket connected to an IMAP server on port 993 (or custom). * Returns a connected Socket ready to pass to ImapClient. */ export declare function createImapTlsSocket(host: string, port: number, timeoutMs?: number): Promise; /** * Creates a PLAIN socket connected to an IMAP server (port 143 by convention). * * Reached only when `surfaces.email.imap.secure` is false. Nothing here is * encrypted, which is the point: an IMAP server on localhost, or a fake in an * acceptance run, offers no TLS to negotiate, and every hosted provider is * served by `createImapTlsSocket` above. */ export declare function createImapPlainSocket(host: string, port: number, timeoutMs?: number): Promise; /** Connect TLS-direct (implicit TLS, port 465). */ export declare function createSmtpTlsSocket(host: string, port: number, timeoutMs?: number): Promise; /** Connect plain then upgrade via STARTTLS (port 587). */ export declare function createSmtpStartTlsSocket(host: string, port: number, timeoutMs?: number): Promise; /** * The real transports, as the `EmailTransportPort` the service asks for. * * Hand this to `new EmailService({ transport: nodeEmailTransport, ... })` in * production. A test hands over one whose members throw, which is how a test * proves it never reached for a real host. */ export declare const nodeEmailTransport: EmailTransportPort; //# sourceMappingURL=node.d.ts.map