1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

smtpsrv: Don't consider client EOF an error

When the client closes the connection, which is very common, chasquid
logs it as an error ("exiting with error: EOF").

That can be confusing and mislead users, and also makes a lot of
traces be marked as errored, when nothing wrong occurred.

So this patch changes the log to not treat it as an error.
This commit is contained in:
Alberto Bertogli
2020-03-21 16:58:56 +00:00
parent fcbd20cd74
commit c8fbf2ecc9

View File

@@ -280,9 +280,13 @@ loop:
}
if err != nil {
if err == io.EOF {
c.tr.Debugf("client closed the connection")
} else {
c.tr.Errorf("exiting with error: %v", err)
}
}
}
// HELO SMTP command handler.
func (c *Conn) HELO(params string) (code int, msg string) {