On Fri, Jan 19, 2018 at 06:45:29PM +0000, Grant Edwards wrote: > > That'd be magic. How exactly is the command-line MTA supposed to > > get the mail "relayed" without connecting to a remote host? > > Let's not worry about how the command-line MTA works. It has the same > usage as /usr/bin/sendmail and it works. What I am asking for is an > SMTP relay server that will relay incoming my by invoking it.
This is much less efficient than SMTP, so don't expect stellar performance. But sure, Postfix can deliver via an external program. http://www.postfix.org/pipe.8.html main.cf: default_transport = mypipe:dummy master.cf: mypipe unix - n n - - pipe null_sender_replacement= flags=q. user=nobody argv=/usr/local/sbin/myscript -f $sender -- $recipient Note that you to *either* include "." in the flags, or include "-i" in argv if the submission program does "SMTP transparency" (interprets leading dots on lines) by default. Run the script as some dedicated user instead of "nobody" if possible but NOT as "postfix". -- Viktor.