import { type Transporter } from "nodemailer"; import type { EmailConfig } from "./credentials.js"; /** * Test SMTP connectivity and authentication. * Returns null on success, error message on failure. */ export declare function testConnection(config: EmailConfig, password: string, token?: string): Promise; /** Options accepted by sendEmail and the email-draft composer — one shape, one composer. */ export interface SendOptions { to: string; subject: string; body: string; html?: string; cc?: string[]; bcc?: string[]; inReplyTo?: string; references?: string; headers?: Record; attachments?: Array<{ filename: string; path: string; }>; /** * The message's own Message-ID. Set on the draft compose path so the draft * carries a stable identity that survives Gmail UID churn; left unset on the * SMTP send path, where nodemailer auto-generates one as before. */ messageId?: string; } /** * Build the nodemailer message options shared by the SMTP send path and the * email-draft MIME composer. transport.sendMail() composes via MailComposer * internally, so feeding the same object to MailComposer directly (draft path) * yields the same message structure. */ export declare function buildMailOptions(config: EmailConfig, options: SendOptions): Parameters[0]; /** * Send an email via SMTP. */ export declare function sendEmail(config: EmailConfig, password: string, options: SendOptions): Promise<{ messageId: string; }>; /** * Strip duplicate Re:/RE:/re: prefixes and prepend a single Re:. * Shared by email-reply and the threaded-draft compose path so both derive an * identical threaded subject from a parent's subject. */ export declare function replySubject(subject: string): string; /** * Dispatch a pre-composed raw RFC822 message with an explicit SMTP envelope. * Used to send a stored draft: the bytes already carry the headers, and the * envelope (from + the union of To/Cc/Bcc) is supplied by the caller because a * raw message is not parsed by nodemailer for routing. */ export declare function sendRaw(config: EmailConfig, password: string, raw: Buffer, envelope: { from: string; to: string[]; }): Promise<{ messageId: string | null; }>; /** * Format a copy note for tool success messages: names CC recipients (visible in * the header) and states that BCC was applied without naming them (preserving * the blind semantics). Returns "" when neither is supplied. */ export declare function formatCopyNote(cc?: string[], bcc?: string[]): string; //# sourceMappingURL=smtp.d.ts.map