Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP authentication method(loginauth) #40817

cfclong opened this issue Aug 16, 2020 · 6 comments

SMTP authentication method(loginauth) #40817

cfclong opened this issue Aug 16, 2020 · 6 comments


Copy link

@cfclong cfclong commented Aug 16, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.4 windows/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\15737\AppData\Local\go-build
set GOENV=C:\Users\15737\AppData\Roaming\go\env
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\15737\go
set GOPROXY=,direct
set GOROOT=D:\Go
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\15737\AppData\Local\Temp\go-build883883038=/tmp/go-build -gno-record-gcc-switches

What did you do?

I just added an authentication method: loginAuth

What did you expect to see?

I hope that the official can provide the authentication method of SMTP

What did you see instead?

Lack of an authentication method of SMTP

Copy link

@davecheney davecheney commented Aug 16, 2020

Would you be able to link to the rfc that describes loginAuth authentication. Thank you

Copy link

@dmitshur dmitshur commented Aug 18, 2020

Is this issue about the net/smtp package or something else?

Copy link

@david7482 david7482 commented Aug 22, 2020

I could only find this obsoleted RFC for the AUTH LOGIN mechanism.

In section 1, it mentioned:

The LOGIN SASL mechanism is obsoleted in favor of the PLAIN
SASL mechanism ([PLAIN]). The LOGIN mechanism is documented here
only for the purpose of backwards compatibility with legacy software.
Clients SHOULD implement the PLAIN SASL mechanism and use it whenever
offered by a server. The LOGIN SASL mechanism SHOULD NOT be used by
a client when other plaintext mechanisms are offered by a server.

Although this is obsoleted SMTP auth mechanism, it is still widely supported by SMTP servers, eg.,,, for backward compatibility.

Copy link

@davecheney davecheney commented Aug 22, 2020

Thanks for checking. It looks like this is an obsolete server side authentication mechanism, however net/smtp only supplies a client.

@cfclong could you please explain why you need to use this auth method

Copy link

@david7482 david7482 commented Aug 23, 2020

Client side also needs to implement this authentication mechanism which is similar with the plainAuth:

func PlainAuth(identity, username, password, host string) Auth {

My use case is working on a SMTP client needs to authenticate with some legacy SMTP servers which only support this AUTH LOGIN mechanism.

I understand application could implement its own LoginAuth and just need to fulfill the Auth interface. But, it’s still useful to have this natively out of box.

Copy link

@gopherbot gopherbot commented Sep 18, 2020

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.