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

net/smtp: Truncated multiline error response from smtp.SendMail #5700

Closed
gopherbot opened this issue Jun 13, 2013 · 6 comments
Closed

net/smtp: Truncated multiline error response from smtp.SendMail #5700

gopherbot opened this issue Jun 13, 2013 · 6 comments

Comments

@gopherbot
Copy link

by everton.marques:

What steps will reproduce the problem?
1. See sample program at http://play.golang.org/p/ARHzvn2VHz
2. Since play.golang.org can't open outgoing SMTP, save the program as: mail.go
3. Then run: go run mail.go

What is the expected output?

Full smtp.Sendmail multiline error message.

What do you see instead?

The smtp.SendMail error message is truncated. See below.

C:\>go run mail.go
2013/06/13 18:20:51 auth=[] password=[] sender=[] recipient=[]
2013/06/13 18:20:56 sendSmtp: failure: ["530 5.5.1 Authentication Required. Learn
more at"]
2013/06/13 18:20:56 530 5.5.1 Authentication Required. Learn more at
exit status 1

Which compiler are you using (5g, 6g, 8g, gccgo)?
Don't know. Default. I am compiling with "go install". I run the mail.go test
above with "go run".

Which operating system are you using?
Windows 7 on 64-bit

Which version are you using?  (run 'go version')
go version go1.1 windows/amd64

Please provide any additional information below.

The issue has been reported here:
http://stackoverflow.com/questions/14734999/golang-read-multiline-error-response-from-smtp-sendmail

And here:
https://groups.google.com/d/msg/golang-nuts/e-B71UXjMOI/kz-gXwlA2WYJ
@gopherbot
Copy link
Author

Comment 1 by everton.marques:

Present in go1.1.1 as well.

@bradfitz
Copy link
Contributor

Comment 2:

What host is replying like this?
How can we reproduce?

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 3 by everton.marques:

That reply is from smtp.gmail.com.
The test program I posted at http://play.golang.org/p/ARHzvn2VHz can reproduce the
issue. It opens an SMTP connection to smtp.gmail.com.

@bradfitz
Copy link
Contributor

Comment 4:

This issue was closed by revision 64441d6.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Oct 18, 2013

Comment 5:

Issue #6354 has been merged into this issue.

@gopherbot
Copy link
Author

Comment 6 by jeff@heroku.com:

this is still a problem when closing the data stream.
Here is where the data stream is closed:
https://github.com/jnwhiteh/golang/blob/master/src/net/smtp/smtp.go#L251
It makes a call to d.c.Text.ReadResponse(250) but textproto is setup such that it won't
return continued data in an error case.
https://github.com/jnwhiteh/golang/blob/master/src/net/textproto/reader.go#L251
Is there a reason textproto doesn't continue reading the error message?

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants