1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-15 20:13:16 +02:00

Chore: Handle POP3 RSET command

This commit is contained in:
Ralph Slooten
2024-06-19 15:59:18 +12:00
parent 7991c49312
commit b7ad94211b

View File

@@ -188,7 +188,7 @@ func handleClient(conn net.Conn) {
} else {
sendResponse(conn, "-ERR user not specified")
}
case "STAT", "LIST", "UIDL", "RETR", "TOP", "NOOP", "DELE":
case "STAT", "LIST", "UIDL", "RETR", "TOP", "NOOP", "DELE", "RSET":
if state == TRANSACTION {
handleTransactionCommand(conn, cmd, args, messages, &toDelete)
} else {
@@ -306,6 +306,9 @@ func handleTransactionCommand(conn net.Conn, cmd string, args []string, messages
m := messages[nr-1]
*toDelete = append(*toDelete, m.ID)
sendResponse(conn, "+OK message marked for deletion")
case "RSET":
*toDelete = []string{}
sendResponse(conn, "+OK")
default:
sendResponse(conn, "-ERR unknown command")
}