1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-01-20 03:29:56 +02:00

Add dot-stuffing POP3 comment & RFC link

This commit is contained in:
Ralph Slooten 2024-05-19 00:42:52 +12:00
parent 0de93c7868
commit e192d5efd2

View File

@ -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, ".")