-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the best place to log final response? #13
Comments
func (b *MyBackend) Cleanup() {
if b.cleanupCalled {
return
}
b.cleanupCalled = true
// do cleanup
} |
Thanks for the suggestion. |
On second thought, So The start and end of a message has to be figured out in the Milter backend. Have a look at https://github.com/d--j/go-milter/blob/main/mailfilter/backend.go to see how the mailfilter Backend does this.
go-milter/mailfilter/transaction.go Lines 86 to 97 in f4e3ac5
|
Can we add a new method which will be called ONCE after a single message has been processed? For easy maintenance and troubleshooting, Milter server must log the final response and basic info of each message, so this method will be very neat and make milter development easier. :) Maybe one more method for end of smtp transaction (and called just once)? |
Checked
Seems none of them can precisely match each processed message. |
Sorry for beeing a little bit slow in understanding – can you explain why you need something other than Lines 69 to 75 in 30d4d62
In case the milter backend opts to reject the message before this callback, the milter backend already knows that the current message has ended, why should the |
There's no email message submitted at all, hence it doesn't go through |
I tried to log final response of processed message in
Abort()
,Cleanup()
, but they both got called 2 or more times for one message.So the question is, where should i log final response of processed message? and it should be called only once.
The text was updated successfully, but these errors were encountered: