(This message was rejected because it was all HTNML and too lage)

Hello,

I have observed the following behavior in Postfix 3.5.3 and 3.6.4:

1. A client opens a long-lived SMTP connection and sends multiple messages over 
the same session.
2. Postfix creates a smtpd process and a single corresponding milter connection 
for that session.
3. If the milter process is restarted during this active SMTP session, the 
Postfix?milter socket disappears.
4. Postfix does *not* recreate a new milter connection for the ongoing smtpd 
session.
5. Any subsequent MAIL FROM results in errors such as:

   * `can't read SMFIC_MAIL reply packet header: Application error` (3.6.4)
   * `can't read SMFIC_MAIL reply packet header: Success` (3.5.3)

This leaves the smtpd session in a state where CONNECT was processed 
earlier(first time) but no further mails come to milter as postfix probably 
still tries to send messages to the old socket only(which doesn't exist now)

Given the milter protocol rule that a milter cannot send unsolicited responses, 
what is the recommended way to ensure correctness when persistent SMTP sessions 
are in use? Specifically, is there a mechanism for Postfix to reconnect the 
milter after a milter restart(if a new connection is not coming). I really do 
not prefer to restart postfix everytime a milter restart as that causes visible 
errors on connected clients and ongoing transactions. 

Let me know if any further information is required . Below is quick way on how 
this behaviour can be reproduced. 

Reproduction Steps (minimal):

Run a milter listening on port 8080.

Open an SMTP session via telnet localhost 25 and send a message.

Observe Postfix?milter connections using:

sudo ss -tnp sport = :8080
(One connection appears, tied to the smtpd session.)

Restart the milter while keeping the same telnet SMTP session open.

>From the same telnet session, issue a new MAIL FROM: command.

Postfix immediately logs:

warning: milter ... can't read SMFIC_MAIL reply packet header
because the milter connection for that smtpd session was lost 

Thanks
Ankit Kulkarni

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to