On 2010-03-26 05:32, Stephens, Kurt wrote:
I'd like to have all local postfix deliveries to
go directly into a TCP or UDS (named pipe) socket,
I wrote a small hack for this a few years back, and it has been in
production for a few of our customers ever since. (I believe it's fairly
portable and should compile on most platforms)
You can download it from: http://netilium.org/~mad/sockpipe.c
Its been designed to exit with EX_TEMPFAIL if it can't connect to the
server, or if the server closes while the program is sending data. That
way, Postfix will retry later.
Since there is no protocol involved, Postfix has no way of knowing if
the delivery actually succeeded - you need to make sure that the
receiving program is able to handle the e-mail if it accepts the connection.
Simply put the compiled program as a transport into master.cf, using the
pipe cmd:
---------------------------------------------------------------------
sockdeliv unix - n n - 1 pipe
flags=R eol=\r\n user=nobody argv=/../sockpipe <IP> <PORT>
---------------------------------------------------------------------
Then use something in the lines of "mailbox_transport = sockdeliv" in
main.cf.
Regards,
Martin Adolfsson