diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -173,6 +173,16 @@ func handle_connection(reader *bufio.Reader, writer *bufio.Writer) error { server_state = server_state_helo _, _ = writer.WriteString("250 2.0.0 Ok: Accepted\r\n") _ = writer.Flush() + case "QUIT": + _, _ = writer.WriteString("221 2.0.0 Bye\r\n") + _ = writer.Flush() + return nil + case "RSET": + if server_state != server_state_begin { + server_state = server_state_helo + } + _, _ = writer.WriteString("250 2.0.0 Ok\r\n") + _ = writer.Flush() default: _, _ = writer.WriteString("500 5.5.2 Error: command not recognized\r\n") _ = writer.Flush() |