Closed egeland closed 7 years ago
You're correct, and I like the idea. Thanks. I'll have a look into it.
Wouldn't be that difficult to implement in the serve loop ;)
@Ruxton A connection level timeout would be easy - SetDeadline() will take care of that. However, RFC 2821 specifies different timeouts per command, and I like to be RFC compliant, so I want to have a look at how feasible that might be before I commit anything.
@egeland RFC 5321 specifies a minimum server timeout of 5 minutes while waiting for a command, so I will make that the default. Would you prefer it to send a message before disconnecting (and if so, what message?) or just silently close the connection?
I'm not sure what the usual behaviour of SMTP servers are, when closing due to timeout. Might be worth looking at the documentation for postfix or exim..?
Postfix sends "421 4.4.2 [hostname] Error: timeout exceeded" on connection, HELO and DATA timeouts, so I'll follow that example.
I've implemented a connection timeout and there haven't been any complaints so I'm closing this issue.
It seems like if a client connects, it can stay connected forever - would be good to have a timeout on idle connections. 😅