import type { Attachment, EmailAddress, EmailMessage } from "../../types.mjs"; /** Inputs used to assemble the MIME document. Kept separate from * `EmailMessage` so the builder can be unit-tested in isolation. */ export interface MimeInput { from: EmailAddress; to: EmailAddress[]; cc: EmailAddress[]; bcc: EmailAddress[]; replyTo: EmailAddress[]; subject: string; text?: string; html?: string; amp?: string; headers?: Record; attachments?: ReadonlyArray; date?: Date; messageId?: string; } /** Output of `buildMime()` — the serialized RFC 5322 message plus the list * of envelope recipients (to/cc/bcc merged) for `RCPT TO`. */ export interface MimeOutput { envelope: { from: string; rcpt: string[]; }; body: string; headers: Record; } export declare function normalizeMimeInput(msg: EmailMessage, messageId: string, date?: Date): MimeInput; export declare function buildMime(input: MimeInput): MimeOutput; /** Dot-stuff a body for DATA transmission per RFC 5321 §4.5.2. Lines that * begin with `.` get an extra `.` prepended so the sequence `\r\n.\r\n` * never appears inside the payload. Returns a single string with CRLF * line endings. */ export declare function dotStuff(body: string): string;