aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-13 12:10:25 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-13 12:10:25 +0800
commitac1e7389a083aceb87a8cb6fa81a0687a1334e75 (patch)
treea50faff22c1fa671ac5c922696fd5e6c31132a5c
parentAdd PostgreSQL mail store support (diff)
downloadmaild-ac1e7389a083aceb87a8cb6fa81a0687a1334e75.tar.gz
maild-ac1e7389a083aceb87a8cb6fa81a0687a1334e75.tar.zst
maild-ac1e7389a083aceb87a8cb6fa81a0687a1334e75.zip
Close connections on QUIT
-rw-r--r--mx_recv.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/mx_recv.go b/mx_recv.go
index 221d8eb..8df6cfa 100644
--- a/mx_recv.go
+++ b/mx_recv.go
@@ -198,6 +198,10 @@ func (session *mx_recv_session) handle() error {
case "QUIT":
_, _ = session.buf_conn.WriteString("221 2.0.0 Bye\r\n")
_ = session.buf_conn.Flush()
+ if session.tls_conn != nil {
+ session.tls_conn.Close()
+ }
+ session.net_conn.Close()
return nil
case "NOOP":
_, _ = session.buf_conn.WriteString("250 2.0.0 Ok\r\n")