mhale / smtpd

An SMTP server package written in Go, in the style of the built-in HTTP server.
The Unlicense
404 stars 92 forks source link

remove `loop` and `break loop` #22

Closed gdamjan closed 3 years ago

gdamjan commented 3 years ago

This fixes the issue that smtpd doesn't close the connection after it sends this message: 421 4.4.2 ip-172-31-64-149 AWS SMTP Relay ESMTP Service closing transmission channel after timeout exceeded

gdamjan commented 3 years ago

quit also doesn't close the socket, ex:

$ ncat --crlf -v localhost 25
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:25.
220 ip-172-31-64-149 AWS SMTP Relay ESMTP Service ready
HELO localhost
…
250 2.0.0 Ok: queued
QUIT
221 2.0.0 ip-172-31-64-149 AWS SMTP Relay ESMTP Service closing transmission channel

^ the connection is still up here, only after I close it by ctrl-c in ncat it will show: Ncat: 280 bytes sent, 358 bytes received in 213.86 seconds.

This has been the focus of the second commit of this PR

gdamjan commented 3 years ago

the PR is incorrect, since I'm a dumbass and didn't know Golang.

The issue is still present though