-
Notifications
You must be signed in to change notification settings - Fork 254
Open
Labels
Description
In an environment like kubernetes hosted on AWS, the server needs to handle health checks from load balancers. A TCP health check only checks that a connection can be established, and then closes without sending any data or waiting for a greeting. go-smtp's Server then logs error messages like
handler error: read tcp 127.0.0.1:9025->127.0.0.1:55372: read: connection reset by peer
which in the case of most health check intervals (< 5 min) means noisy logs with lots of pointless error messages (the noise is the problem, not any functionality of the Server itself). Instead, Server.handleConn() should check whether any bytes were sent and only log an error if the connection was non-empty.