aboutsummaryrefslogtreecommitdiff
path: root/serve_imap.go
diff options
context:
space:
mode:
Diffstat (limited to 'serve_imap.go')
-rw-r--r--serve_imap.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/serve_imap.go b/serve_imap.go
index b62f384..524f130 100644
--- a/serve_imap.go
+++ b/serve_imap.go
@@ -2,6 +2,7 @@ package main
import (
"bufio"
+ "bytes"
"context"
"crypto/tls"
"encoding/base64"
@@ -68,7 +69,12 @@ func (session *imap_recv_session) handle(ctx context.Context) error {
_ = session.buf_conn.Flush()
break switch_cmd
}
- clog.Debug(fmt.Sprintf("argumetn=%#v", string(argument)))
+ segments := bytes.Split(argument, []byte{0})
+ if len(segments) != 3 {
+ session.buf_conn.WriteString(" TODO need three sasl segments\r\n")
+ break switch_cmd
+ }
+ authcid, passwd := segments[1], segments[2]
default:
_, _ = session.buf_conn.WriteString(line + " TODO i don't know this authentication method\r\n")
_ = session.buf_conn.Flush()