go-gomail / gomail

The best way to send emails in Go.
MIT License
4.39k stars 579 forks source link

closing amazon ses timeout returns "421 Timeout waiting for data from client" #68

Closed sairam closed 7 years ago

sairam commented 7 years ago

panic: 421 Timeout waiting for data from client.

I am following the example from the documentation Example (Daemon) . Snippet

            case <-time.After(30 * time.Second):
                if open {
                    if err := s.Close(); err != nil {
                        panic(err)
                    }
                    open = false
                }

I am seeing the following error - panic: 421 Timeout waiting for data from client. whenever the timeout gets invoked.

When I remove the panic, The TCP connection failing to close goes into a CLOSE_WAIT leaving it about sometime

relevant file : https://github.com/go-gomail/gomail/blob/master/writeto.go

Operating System : OS X

sairam commented 7 years ago

Changing the timeout to 5 seconds (I am timing out at 4) solves the problem.

Not covered in AWS documentation as well.

Thanks for the amazing library!

akrantz01 commented 5 years ago

@sairam Where did you change the timeout?

sairam commented 5 years ago

I don't recall exactly where this is, but look at https://github.com/sairam/kinli/blob/master/mailer.go#L79

The project I am using this library is at GitHub.com/Sairam/gitnotify

On Mon, Jun 3, 2019, 08:02 Alexander Krantz notifications@github.com wrote:

@sairam https://github.com/sairam Where did you change the timeout?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/go-gomail/gomail/issues/68?email_source=notifications&email_token=AABH6AGACQ4WYPZNQTCXXYTPYR7C3A5CNFSM4CXV72UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWYE2HQ#issuecomment-498093342, or mute the thread https://github.com/notifications/unsubscribe-auth/AABH6AGK4ELKSIRBVZYWFNLPYR7C3ANCNFSM4CXV72UA .