/** Input validation and sanitization utilities. */ /** * Reduce a sender-supplied attachment name to one that is safe to write. * * The name arrives in the message's Content-Disposition header, so anyone who * can email the user chooses it. Passed to `path.join` as-is, a name like * `../../../../.zshrc` escapes the destination directory entirely and * overwrites whatever sits there — and since the CLI defaults its destination * to the working directory, even a plain leading dot is enough to drop a file * that shell startup will read. * * The result is always a bare filename: no directory part, no control * characters, no leading dot, and never empty. */ export declare function safeAttachmentFilename(name: string): string; /** * Validate and sanitize an IMAP mailbox name. * Rejects names containing IMAP wildcard characters (`*`, `%`) or empty strings. * @param name - The mailbox name to validate. * @returns The trimmed mailbox name. */ export declare function sanitizeMailboxName(name: string): string; /** * Strip control characters from an IMAP search query. * Removes ASCII 0-31 except tab (0x09) and newline (0x0A). * @param query - The raw search query. * @returns The sanitized query string. */ export declare function sanitizeSearchQuery(query: string): string; /** * Validate a webhook URL. * Ensures the URL uses http(s) and does not point to a private or loopback address. * @param url - The webhook URL to validate. */ export declare function validateWebhookUrl(url: string): void; /** * Sanitize a value for use in a template. * When `html` is true, HTML-special characters are escaped. * @param value - The template variable value. * @param html - Whether to apply HTML escaping. * @returns The sanitized value. */ export declare function sanitizeTemplateVariable(value: string, html: boolean): string; /** * Validate an email label name. * Rejects labels with control characters or that exceed 200 characters. * @param name - The label name to validate. * @returns The trimmed label name. */ export declare function validateLabelName(name: string): string; /** * Validate that an input string does not exceed a maximum length. * @param input - The input string to check. * @param maxLength - The maximum allowed length. * @param fieldName - The field name for the error message. */ export declare function validateInputLength(input: string, maxLength: number, fieldName: string): void; //# sourceMappingURL=validation.d.ts.map