From 7773c6b04cbee1b336ded056384f40d5e1d41685 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Wed, 19 Jun 2024 15:46:38 +1200 Subject: [PATCH] Commands in the POP3 are case-insensitive (see RFC1939) --- server/pop3/pop3.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/pop3/pop3.go b/server/pop3/pop3.go index 72dc77b..c98989c 100644 --- a/server/pop3/pop3.go +++ b/server/pop3/pop3.go @@ -23,9 +23,12 @@ import ( ) const ( + // AUTHORIZATION is the initial state AUTHORIZATION = 1 - TRANSACTION = 2 - UPDATE = 3 + // TRANSACTION is the state after login + TRANSACTION = 2 + // UPDATE is the state before closing + UPDATE = 3 ) // Run will start the POP3 server if enabled @@ -134,6 +137,7 @@ func handleClient(conn net.Conn) { // Parses the command cmd, args := getCommand(rawLine) + cmd = strings.ToUpper(cmd) // Commands in the POP3 are case-insensitive logger.Log().Debugf("[pop3] received: %s (%s)", strings.TrimSpace(rawLine), conn.RemoteAddr().String())