Skip to content

Commit

Permalink
Add dot-stuffing POP3 comment & RFC link
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed May 18, 2024
1 parent 0de93c7 commit e192d5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/pop3/pop3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ".")

Expand Down

0 comments on commit e192d5e

Please sign in to comment.