When the session reaches the DATA part it can stay open forever there is no timeout that would close the session here. This allows the connection to remain open forever. I think it would make sense to be able to define an overall timeout for a session.
I think if we create a LinkedTokenSource in the SmtpSession with a timeout we could easily solve the problem.
|
async Task ExecuteAsync(SmtpSessionContext context, CancellationToken cancellationToken) |
When the session reaches the
DATApart it can stay open forever there is no timeout that would close the session here. This allows the connection to remain open forever. I think it would make sense to be able to define an overall timeout for a session.I think if we create a
LinkedTokenSourcein theSmtpSessionwith a timeout we could easily solve the problem.SmtpServer/Src/SmtpServer/SmtpSession.cs
Line 57 in 9d253c4