From efc0dbed3b1752c55d052a0e2468292fbe97f22f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 2 Jan 2017 03:07:56 -0500 Subject: [PATCH] Add more logging for the POP3 server. --- pop3/conn.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pop3/conn.go b/pop3/conn.go index b1df280..a15c1f6 100644 --- a/pop3/conn.go +++ b/pop3/conn.go @@ -93,7 +93,6 @@ func AcceptConnection(netConn net.Conn, po PostOffice, log zap.Logger) { case "UIDL": conn.doUIDL() default: - conn.log.Error("unknown command") conn.err("unknown command") } } @@ -241,6 +240,7 @@ func (conn *connection) doRETR() { return } + conn.log.Info("retreive message", zap.String("unique-id", msg.UniqueID())) conn.ok(fmt.Sprintf("%d", msg.Size())) w := conn.tp.DotWriter() @@ -268,6 +268,7 @@ func (conn *connection) doDELE() { conn.log.Error("failed to delete message", zap.Error(err)) conn.err(err.Error()) } else { + conn.log.Info("delete message", zap.String("unique-id", msg.UniqueID())) conn.ok("") } } @@ -278,6 +279,7 @@ func (conn *connection) doRSET() { return } conn.mb.Reset() + conn.log.Info("reset") conn.ok("") } -- 2.43.5