浏览代码

Fix wait for QUIT in wrong state

Thomas Dy 2 年之前
父节点
当前提交
1d5e47d8ec
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      smtp.ts

+ 3 - 3
smtp.ts

@@ -79,9 +79,6 @@ export class Session {
     if (command === "HELO" || command === "EHLO") {
       this.state = State.WaitingMail;
       this.output("250 OK");
-    } else if (command === "QUIT") {
-      this.output("221 smtp2rss closing");
-      this.conn.close();
     } else {
       this.output("500 Invalid state");
     }
@@ -98,6 +95,9 @@ export class Session {
       } else {
         this.output("500 Invalid sender");
       }
+    } else if (command === "QUIT") {
+      this.output("221 smtp2rss closing");
+      this.conn.close();
     } else {
       this.output("500 Invalid state");
     }