]> Cypherpunks repositories - gostls13.git/commit
net/smtp: make Client.Auth trim final space if Auth.Start toServer is empty
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 11 Nov 2016 20:35:26 +0000 (20:35 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 11 Nov 2016 21:00:11 +0000 (21:00 +0000)
commit10d2efd0b0e3f4f92f9470435f63211cbeb82008
tree1b1b29743cc4291718ee93c1e592846383822e79
parente6da64b6c070eeb872ca141ab58435e7be5da388
net/smtp: make Client.Auth trim final space if Auth.Start toServer is empty

Users can implement the smtp.Auth interface and return zero bytes in
the "toServer []byte" return value from the Auth.Start method. People
apparently do this to implement the SMTP "LOGIN" method.

But we were then sending "AUTH LOGIN \r\n" to the server, which some
servers apparently choke on. So, trim it when the toServer value is
empty.

Fixes #17794

Change-Id: I83662dba9e0f61b1c5000396c096cf7110f78361
Reviewed-on: https://go-review.googlesource.com/33143
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/smtp/smtp.go
src/net/smtp/smtp_test.go