import { EmailAccessor } from '../../../../accessor/email.ts'; import type { ParsedRfc822 } from '../../../../core/email/_parse.ts'; import type { EmailConfig } from '../../../../core/email/config.ts'; export interface Delivery { parsed: ParsedRfc822; /** A line for stderr, empty when there is nothing to report. */ warning: string; } /** * Names the mailbox a sent copy belongs in. * * IMAP never standardized that name: it is `Sent` on most servers, * `Sent Items` on Exchange and `[Gmail]/Sent Mail` on Gmail. A server * that implements RFC 6154 tags the right one \Sent in its LIST reply, * so asking beats guessing; upstream himalaya has no probe and falls * back on its folder.alias.sent, which is the configured name here and * wins so a server whose tag is wrong stays correctable. */ export declare function resolveSentFolder(accessor: EmailAccessor, configured: string | null): Promise; /** * APPENDs a message to a mailbox, seen, and answers with the mailbox it * landed in. `named` is the mailbox --save gave; without one the * account's own sent mailbox is resolved. * * Unlike python's, this path quotes nothing: imapflow builds the * command from typed attributes, so a mailbox holding a space arrives * as one argument on its own. */ export declare function saveSentCopy(config: EmailConfig, raw: Uint8Array, named?: string | null): Promise; /** * Sends a message over SMTP, then files the sender's own copy. * * Two conversations with two servers: SMTP hands the message to the * recipient's side and keeps no record, so the copy in the sender's * Sent mailbox is a separate IMAP APPEND that every mail client makes * on its own. Upstream v2 spells that APPEND as `--save ` and * does nothing without it; mirage keeps the account-level `saveCopy` on * top, defaulted on, so an agent that never learned the flag still * leaves the record a human sender would. * * The other deliberate divergence is the failure arm. Upstream * propagates, which fails the command after the mail has already left; * here the APPEND failure is reported on stderr and the verb still * succeeds, because a non-zero exit invites a retry that sends the * message twice. A `--save` that sends nothing does not go through here * at all, precisely because nothing happened yet and failing is safe. */ export declare function deliver(config: EmailConfig, raw: Uint8Array, save?: string | null): Promise; //# sourceMappingURL=deliver.d.ts.map