From: Robert Sesek Date: Mon, 2 Jan 2017 08:07:56 +0000 (-0500) Subject: Add more logging for the POP3 server. X-Git-Tag: v1.1.0~2 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=efc0dbed3b1752c55d052a0e2468292fbe97f22f;p=mailpopbox.git Add more logging for the POP3 server. --- 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("") }