Skip to content

Commit b1eaf52

Browse files
authored
Merge pull request #15 from moukoublen/issue8
Do not perform authentication when username and password are empty
2 parents 169679c + b906dfc commit b1eaf52

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server_conn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ func (sc *serverConn) connect() error {
114114

115115
// Auth performs SASL authentication (using the PLAIN method) with the server.
116116
func (sc *serverConn) auth() error {
117+
if len(sc.username) == 0 && len(sc.password) == 0 {
118+
return nil
119+
}
117120
s, err := sc.authList()
118121
if err != nil {
119122
return err

0 commit comments

Comments
 (0)