Thanks so much for the information! Also, tempfail does work correctly. But
couple of questions though,

1. When default action is tempfail and the milter is unavailable, smtpd
sends 451 (Requested action aborted: error in processing). Wonder if there
is a way to send 421 (Service not available, closing transmission channel)
and then close the connection. 451 works fine except that some of the
clients keeps retrying for several minutes before giving up and creating a
new connection. If we have a config option to send 421 and close the
connection it might help it be faster.

2. I noticed that when the milter application exits, it sends FIN to smtpd
but smtpd keeps the connection open in the CLOSE_WAIT state. When the
client sends something new and smptd tries to send SMFIC_ABORT to the
milter on the old connection in the CLOSE_WAIT state it gets a reset and
then the connection is closed. This is not really a problem, but just that
the socket stays in CLOSE_WAIT state sometimes for a long time if there is
nothing new from the client.

Thanks,
Purush

On Wed, May 10, 2017 at 1:33 PM, Wietse Venema <wie...@porcupine.org> wrote:

> Purushotham Nayak:
> > Hi All,
> >
> > I have a question about the correct way to restart a milter application.
> >
> > I'm using postfix 2.6.6 with a milter application that was built using
> > sendmail's libmilter (8.14.7). The problem I'm having is when I need to
> > restart the milter application (due to a config change for example), I
> send
> > it a SIGTERM and then start it up again.
> >
> > However, an smtpd instance that was running which was already connected
> to
> > milter will not try to connect to the milter after the milter has been
> > restarted.
>
> When the milter process is stopped, it loses state of the sessions
> that were in progress.
>
> Postfix does not connect to a milter in the middle of an SMTP
> session, because libmilter has to be able to see all stages of the
> protocol.
>
> > Is there a way to get smtpd to send tempfail to client when milter
> > is not there
>
> I would expect that Postfix does that by default.
>
> > But once the milter starts up and is listening again smtpd reconnects
> > and starts sending data to the milter.
>
> No, see above.
>
>         Wietse
>

Reply via email to