SmtpServer
SmtpServer copied to clipboard
SecureServerExample blocked by telnet
I have a problem where the server stops receiving emails if a telnet connection is open. The telnet connection is stuck in AuthenticateAsServerAsync
within SecurableDuplexPipe
. I can reproduce this issue by using the SecureServerExample
from the repo. If this can either be fixed, or you have a workaround allowing me to block/reject the telnet connects, I would be happy.
I test it by:
- Running the server.
- Starting a jmeter script that continuously sends emails.
- Starting telnet - Observe that the jmeter script stops sending emails.
- Stop telnet - Observe that jmeter starts sending emails again.
Looking at the code it seams that the server performs SSL upgrade syncronously (i.e. it'll start listening to next connection, when previous is authenticated with SSL). I can see 3 possible ways, you could try to fix it:
- disable SSL (only, if you're sure it's safe - closed network, vpn etc.)
- Decrease read timeout - by default it's 2 minutes, you probably can have it safely much lower
- Fix code, so that this line is called in background: https://github.com/cosullivan/SmtpServer/blob/master/Src/SmtpServer/SmtpServer.cs#L160
BTW, @cosullivan - what's the status of this project? Is it still supported?
Hi @karol-gro yes it is still supported, but only when time permits.
I will have a look at this in the next few days.
Hi @cosullivan What is the status on this? Do you expect to get the time to look into it?
Hi @mrFred489 ,
I've uploaded 9.0.2-beta1 which should solve this. If you are able to test to confirm that would be good.
Hi @cosullivan
It seems to be working. It looks like you took the suggestion from @karol-gro, so the server can handle messages while attempting to secure another connection.
Thank you for fixing this!