aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.go b/main.go
index cdd6b11..d894d8c 100644
--- a/main.go
+++ b/main.go
@@ -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()