Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(31)

Issue 6946057: code review 6946057: net/smtp: add optional Hello method (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by rick
Modified:
11 years, 4 months ago
Reviewers:
dave
CC:
golang-dev, rsc
Visibility:
Public.

Description

net/smtp: add optional Hello method Add a Hello method that allows clients to set the server sent in the EHLO/HELO exchange; the default remains localhost. Based on CL 5555045 by rsc. Fixes issue 4219.

Patch Set 1 #

Patch Set 2 : diff -r 5a40587c014a https://code.google.com/p/go/ #

Patch Set 3 : diff -r 5a40587c014a https://code.google.com/p/go/ #

Total comments: 1

Patch Set 4 : diff -r 5a40587c014a https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -9 lines) Patch
M src/pkg/net/smtp/smtp.go View 1 2 3 11 chunks +57 lines, -8 lines 0 comments Download
M src/pkg/net/smtp/smtp_test.go View 1 3 chunks +191 lines, -1 line 0 comments Download

Messages

Total messages: 8
rick
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 4 months ago (2012-12-14 22:34:27 UTC) #1
rsc
LGTM https://codereview.appspot.com/6946057/diff/4001/src/pkg/net/smtp/smtp.go File src/pkg/net/smtp/smtp.go (right): https://codereview.appspot.com/6946057/diff/4001/src/pkg/net/smtp/smtp.go#newcode85 src/pkg/net/smtp/smtp.go:85: return errors.New("Hello called after other SMTP exchanges") "smtp: ...
11 years, 4 months ago (2012-12-17 00:08:04 UTC) #2
rick
PTAL
11 years, 4 months ago (2012-12-17 01:16:30 UTC) #3
rsc
LGTM
11 years, 4 months ago (2012-12-17 01:18:37 UTC) #4
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=d68fadb4593f *** net/smtp: add optional Hello method Add a Hello method that ...
11 years, 4 months ago (2012-12-17 01:19:29 UTC) #5
dave_cheney.net
Hi Rick, Would you be able to look into this issue, https://code.google.com/p/go/issues/detail?id=4559, which I think ...
11 years, 4 months ago (2012-12-17 04:00:27 UTC) #6
rsc
I tried this: diff -r d2c79fccab13 src/pkg/net/smtp/smtp_test.go --- a/src/pkg/net/smtp/smtp_test.go Mon Dec 17 23:01:36 2012 +0800 ...
11 years, 4 months ago (2012-12-17 15:35:30 UTC) #7
rick
11 years, 4 months ago (2012-12-17 15:37:57 UTC) #8
I fixed that with this CL: https://codereview.appspot.com/6944057

On Monday, December 17, 2012 10:35:27 AM UTC-5, rsc wrote:
>
> I tried this: 
>
> diff -r d2c79fccab13 src/pkg/net/smtp/smtp_test.go 
> --- a/src/pkg/net/smtp/smtp_test.go Mon Dec 17 23:01:36 2012 +0800 
> +++ b/src/pkg/net/smtp/smtp_test.go Mon Dec 17 10:34:35 2012 -0500 
> @@ -385,7 +385,11 @@ 
>   } 
>   defer l.Close() 
>
> + doneWriting := make(chan bool, 1) 
>   go func(l net.Listener, data []string, w *bufio.Writer) { 
> + defer func() { 
> + doneWriting <- true 
> + }() 
>   i := 0 
>   conn, err := l.Accept() 
>   if err != nil { 
> @@ -429,10 +433,11 @@ 
>   t.Errorf("%v", err) 
>   } 
>
> + <-doneWriting 
>   bcmdbuf.Flush() 
>   actualcmds := cmdbuf.String() 
>   if client != actualcmds { 
> - t.Errorf("Got:\n%s\nExpected:\n%s", actualcmds, client) 
> + t.Errorf("Got:\n%q\nExpected:\n%q", actualcmds, client) 
>   } 
>  } 
>
> but now I get (from GOMAXPROCS=2 go test -race): 
>
> smtp_test.go:440: Got: 
> "EHLO localhost\r\nHELO localhost\r\nMAIL 
> FROM:<te...@example.com <javascript:>>\r\nRCPT 
> TO:<ot...@example.com <javascript:>>\r\nDATA\r\nFrom:
te...@example.com<javascript:>\r\nTo: 
>
> ot...@example.com <javascript:>\r\nSubject: SendMail test\r\n\r\nSendMail 
> is working 
> for me.\r\n.\r\nQUIT\r\n\r\n" 
> Expected: 
> "EHLO localhost\r\nHELO localhost\r\nMAIL 
> FROM:<te...@example.com <javascript:>>\r\nRCPT 
> TO:<ot...@example.com <javascript:>>\r\nDATA\r\nFrom:
te...@example.com<javascript:>\r\nTo: 
>
> ot...@example.com <javascript:>\r\nSubject: SendMail test\r\n\r\nSendMail 
> is working 
> for me.\r\n.\r\nQUIT\r\n" 
>
> The difference between the two strings is the doubled \r\n after QUIT 
> in the 'Got' string. 
>
> Russ 
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b