diff options
author | Runxi Yu <me@runxiyu.org> | 2025-01-15 20:17:36 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-01-15 20:17:36 +0800 |
commit | 71d2d56cd4b4112b33b73322d1680dd965113018 (patch) | |
tree | bc40e0de74af7e1b79e92af40f09e77f329a6de5 /serve_imap.go | |
parent | Put mx side parsing code into a block (diff) | |
download | maild-71d2d56cd4b4112b33b73322d1680dd965113018.tar.gz maild-71d2d56cd4b4112b33b73322d1680dd965113018.tar.zst maild-71d2d56cd4b4112b33b73322d1680dd965113018.zip |
Minor fixes
Diffstat (limited to 'serve_imap.go')
-rw-r--r-- | serve_imap.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/serve_imap.go b/serve_imap.go index 64a6ad0..2789ca3 100644 --- a/serve_imap.go +++ b/serve_imap.go @@ -2,9 +2,9 @@ package main import ( "bufio" - "fmt" "context" "crypto/tls" + "fmt" "io" "net" "strings" @@ -32,8 +32,8 @@ type imap_recv_session struct { func (session *imap_recv_session) handle(ctx context.Context) error { session.buf_conn = bufio.NewReadWriter(bufio.NewReader(session.net_conn), bufio.NewWriter(session.net_conn)) - session.buf_conn.WriteString("* OK [CAPABILITY IMAP4rev2 AUTH=PLAIN] " + VERSION + "\r\n") - session.buf_conn.Flush() + _, _ = session.buf_conn.WriteString("* OK [CAPABILITY IMAP4rev2 AUTH=PLAIN] " + VERSION + "\r\n") + _ = session.buf_conn.Flush() for { var tag, cmd, param string @@ -49,8 +49,8 @@ func (session *imap_recv_session) handle(ctx context.Context) error { line = strings.TrimSuffix(line, "\r") tag_end := strings.IndexByte(line, ' ') if tag_end == -1 { - session.buf_conn.WriteString(line+" BAD Error in IMAP command received by server.\r\n") - session.buf_conn.Flush() + _, _ = session.buf_conn.WriteString(line + " BAD Error in IMAP command received by server.\r\n") + _ = session.buf_conn.Flush() continue } tag = line[:tag_end] |