From c8fbf2ecc92af5f47d260827d23a6aa82f4ed696 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sat, 21 Mar 2020 16:58:56 +0000 Subject: [PATCH] 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. --- internal/smtpsrv/conn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/smtpsrv/conn.go b/internal/smtpsrv/conn.go index f051012..0568581 100644 --- a/internal/smtpsrv/conn.go +++ b/internal/smtpsrv/conn.go @@ -280,7 +280,11 @@ loop: } if err != nil { - c.tr.Errorf("exiting with error: %v", err) + if err == io.EOF { + c.tr.Debugf("client closed the connection") + } else { + c.tr.Errorf("exiting with error: %v", err) + } } }