From e192d5efd2b291641846ba9d329f7a2b212e9903 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Sun, 19 May 2024 00:42:52 +1200 Subject: [PATCH] Add dot-stuffing POP3 comment & RFC link --- server/pop3/pop3.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/pop3/pop3.go b/server/pop3/pop3.go index f98506e..f9e424a 100644 --- a/server/pop3/pop3.go +++ b/server/pop3/pop3.go @@ -239,6 +239,13 @@ func handleClient(conn net.Conn) { size := len(raw) sendData(conn, fmt.Sprintf("+OK %d octets", size)) + + // When all lines of the response have been sent, a + // final line is sent, consisting of a termination octet (decimal code + // 046, ".") and a CRLF pair. If any line of the multi-line response + // begins with the termination octet, the line is "byte-stuffed" by + // pre-pending the termination octet to that line of the response. + // @see: https://www.ietf.org/rfc/rfc1939.txt sendData(conn, strings.Replace(string(raw), "\n.", "\n..", -1)) sendData(conn, ".")