import type { ParsedEmail } from "../types.js"; import type { EmailLogger } from "../utils/logger.js"; export declare function ensureDownloadDir(): Promise; /** * Sanitize an attachment filename to prevent path traversal attacks. * * - Rejects filenames containing null bytes (potential null byte injection). * - Strips all directory components via path.basename so that crafted names * like "../../etc/passwd" or "/etc/passwd" resolve to just "passwd". * - Falls back to "attachment" when the result would be empty. */ export declare function sanitizeAttachmentFilename(filename: string): string; /** * Parse email headers from IMAP message */ export declare function parseEmailHeaders(headers: Record): { from: string; to: string[]; cc: string[]; bcc: string[]; subject: string; messageId: string; references: string[]; inReplyTo: string | null; }; /** * Parse full email from raw source */ export declare function parseEmail(raw: Buffer | string, uid: number, log?: EmailLogger): Promise; /** * Extract subject from text (first line) */ export declare function extractSubject(text: string): string;