go-milter icon indicating copy to clipboard operation
go-milter copied to clipboard

server: add Milter.Close

Open HansK-p opened this issue 3 years ago • 1 comments

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.

HansK-p avatar Jan 05 '22 17:01 HansK-p

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.

d--j avatar Mar 17 '23 00:03 d--j