On Wed, Oct 08, 2014 at 06:17:45PM -0700, Ronald F. Guilmette wrote:

> The SMTPD_POLICY_README file says:
> 
> "In case of trouble the policy server must not send a reply. Instead the 
> server
> must log a warning and disconnect. Postfix will retry the request at some 
> later
> time."
> 
> 
> Ummm...
> 
> I can easly handle the "log a warning" part, but...
> 
> As I understand it, a Postfix policy server is supposed to be reading
> incoming requests from stdin.

No, it is supposed to be accepting requests via TCP or unix domain
socket.  It can even handle multiple connections via a threaded or
event based model.

> How exactly does one "disconnect" from stdin?  I mean other than by
> calling exit() ?

One can close a file descriptor.  However, when created by spawn(8)
the process handles just one connection, so there is nothing left
to do after closing the connection but exit().  Since exit() also
closes all files, that's enough.  In particular such a server must[
also exit when a read of stdin reports EOF.

For servers not created by spawn(8), other strategies are applicable.

-- 
        Viktor.

Reply via email to