On Mon, Jan 30, 2023 at 03:41:47PM -0800, David Koski wrote: > > You can add instances of the spawn(8) service in master.cf to fork/exec > > per-connection programs, it is only suitable in low-throughput > > environments. This is the analogue of pipe(8) you were looking for. > > I tried spawn but did not see a way to pass parameters for sender/recipient.
Advanced filters talk SMTP. The envelope is transmitted as part of the SMTP dialogue. > > Generally, your filter should be a standalone network listener, launched > > separately from and prior to Postfix (and shut down after). It should > > ideally not fork/exec per message, though at sufficiently low message > > rates this may not matter. > > Is there a way for a standalone listener to receive parameters for > sender/recipient? Otherwise, I could just read the header, no? But I > will have to determine begin/end of message. With various pauses for server banner and replies the client sends: EHLO client.fqdn.example MAIL FROM:<envelope-sender@sender.domain.example> RCPT TO:<envelope-recipient1@recipient.domain.example> ... RCPT TO:<envelope-recipientN@recipient.domain.example> DATA <headers> <body> . The server implements the SMTP protocol, parsing the commands and returning appropriate replies. A pure proxy can punt the SMTP protocol mostly downstream, returning the backend replies, but peek at the command stream to learn the sender and recipient, and potentially delay body transmission if it may need to be modified. -- Viktor.