import { type PHPEventWithStdinTransfer } from '../php-event'; /** * Limit captured sendmail stdin to 20 MB to match common email size limits. * * Gmail limits email attachments to 25 MB https://support.google.com/mail/answer/6584 * Outlook limits email attachments to 20 MB https://support.microsoft.com/outlook/reduce-attachment-size-to-send-large-files-with-outlook */ export declare const SENDMAIL_CAPTURE_MAX_SIZE: number; /** * Emitted when a sendmail null transport receives the first stdin bytes from * `mail()`, `popen()`, `proc_open()`, or any other spawn of a `sendmail` binary. */ export interface PHPSendmailSpawnedEvent extends PHPEventWithStdinTransfer { type: 'sendmail.spawned'; } /** * Creates a sendmail-compatible null transport for the given PHP instance. * Every message handed to sendmail – via mail(), proc_open(), etc. – is streamed * from stdin, dispatched as a `sendmail.spawned` event, and never delivered. * A listener that wants real delivery must relay the message itself. * * The captured payload is exposed as the raw bytes written to sendmail stdin. * * This stream does not apply backpressure to PHP. Each listener queues unread * chunks in JavaScript memory when it reads more slowly than PHP writes. The * source accepts at most SENDMAIL_CAPTURE_MAX_SIZE bytes. Cancelling the stream * stops delivery through that stream without terminating the sendmail process. */ export declare function sendmailSpawnHandler(php: { dispatchEvent: (event: PHPSendmailSpawnedEvent) => void; }): any;