emersion / go-milter

Go library to write mail filters
BSD 2-Clause "Simplified" License
42 stars 19 forks source link

Connect information is lost when the milter receives an abort #19

Closed HansK-p closed 2 years ago

HansK-p commented 2 years ago

According to the spec at https://github.com/avar/sendmail-pmilter/blob/master/doc/milter-protocol.txt, an abort command "Resets internal state of milter program to before SMFIC_HELO, but keeps the connection open".

My challenge is that a new milter backend is created when an abort command is received. This results in the connect information being lost and the new milter session can not act based on connect information and headers as connect was made before the abort.

I'm not sure how this should be solved. One option could be to send the Abort command to the milter backend instead of creating a new backend. Another, but probably worse, option could be to resend the connect information. The same goes for the action if a continue isn't received, but I don't think this part has been a challenge for me. This is an issue for me as Postfix in our setup is always sending a reset before sending header and ibody (not sure why, but it might be normal).

I am using the go-milter library together with Postfix version 3.5.6.

HansK-p commented 2 years ago

I managed to overlook that #12 is exactly the same thing. I'll close this issue and add a comment to #12.