go-milter
go-milter copied to clipboard
server: add Milter.Close
It would be good to be notified when the milter is closed. My use case is to store the email to file. One option is to open, write and close the file each time body content is received or keep the email in memory until Milter.Body is called, but it would be good if the file can be kept open. I suppose a more "sensible" use case is to ensures that cleanup is done when the milter is closed. Like deleting temporary files.
I took the liberty to fork and rewrite go-milter. In this fork you will find a Cleanup()
method that always gets called (even when the connection abruptly disconnects) so you can e.g. close and remove your copy of the body chunks.