On 2018-01-19, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote: > 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.
No worries, I need to handle a couple messages per week. > 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". Ah! That does look like what I've been trying to find. Now that I know what to google for, this looks like it's close to what I'm trying to do: https://serverfault.com/questions/258469/how-to-configure-postfix-to-pipe-all-incoming-email-to-a-script But, that example is set up so the pipe is only invoked for a particular domain. Thanks! -- Grant Edwards grant.b.edwards Yow! I selected E5 ... but at I didn't hear "Sam the Sham gmail.com and the Pharoahs"!