lists+post...@sad.lv: > Hello ! > > I met an issue with milter when multiple messages pushed within single > smtp session (using pipelining indeed): > warning: milter unix:/run/t.socket: unexpected filter response > SMFIR_ADDHEADER after event SMFIC_MAIL > > It looks similar for > https://www.mail-archive.com/postfix-users@postfix.org/msg13652.html
This was caused by a bug in Sendmail::PMilter. Background: the SMTP protocol supports multiple MAIL transactions per SMTP connection. After each successful or unsuccessful MAIL transaction, Postfix sends an SMFIC_ABORT command to all Milters, to ensure that they are in a knwn state for the next MAIL transaction. The Sendmail::PMilter code comes with a description of the Milter protocol that says: COMMAND CODES ... 'A' SMFIC_ABORT Abort current filter checks Expected response: NONE ... Yet, when the Sendmail::PMilter receives SMFIC_ABORT, it sends a response (SMFIR_CONTINUE). Evidence from PMilter logging: Fri Dec 9 20:14:15 2022 PID=13886 Context.pm(215): main(eval): got command=[A] Fri Dec 9 20:14:15 2022 PID=13886 Context.pm(508): call_hooks: (non-existent callback=[abort]) write =>c<= >< The command=[A] is SMFIC_ABORT, and the =>c<= response is SMFIR_CONTINUE. Because of this "extra" response, Postfix and Sendmail::PMilter are now out of step, and eventually Postfix complains about a protocol error. Wietse