-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QUIT
command crashes server
#239
Comments
Well, seems it's not 100% related to the broken "quit" command, but rather to the fact that we used to not account for the possibility that socket will be suddenly closed. It was partially solved in #211 and especially by https://github.com/gen-smtp/gen_smtp/pull/226/files#r515038937, but, at least the last one is not in hex.pm yet |
But why gen_smtp/src/gen_smtp_server_session.erl Line 269 in 54be999
and parse the packets manually untill we get gen_smtp/src/gen_smtp_server_session.erl Line 235 in 54be999
which is a quite dirty hack, since we don't have internal accumulator and handle each chunk of data as a complete message. I have an old stale branch where I tried to address this issue, but never finished it 789a071 because I got some suspicious results from my benchmarks (decreased performance) |
Realized I'm not actually solving this problem in my branch: 789a071#diff-29fce4d0fc07289a91141e488d851aa04fee754665ecde349c0d9c0da839d9b8R254-R255 but at least the problem is acknowleged there |
I'm not well-versed in reading Erlang, unfortunately. But that makes sense to me. Right now I'm seeing this occur about once per 10K emails. Could you help me understand the impact this has right now? Since the session is crashing, I'm assuming gen_smtp will simply start a new one? If that's the case, I could live with that glitch. |
Since it crashes on QUIT and when your peer server have already closed the connection, it should be safe, unless you have some processes linked to SMTP server session. gen_smtp always starts a new process for each session (connection), so, this process would die with normal reason anyway. With this bug it dies a couple milliseconds earlier and spams error logs |
thanks for confirming! I'll leave it up to you to decide whether you want to leave this issue open or not :) |
gen_smtp
is working great for us! One thing pops up occasionally, though. For some reason, the QUIT command crashes the server. Our set up has postfix relay emails to SMTP, so, of course, it could come from there, too? I just wanted to bring this up and see if this rings any bells.(note that the first 3 logs are from our app)
The text was updated successfully, but these errors were encountered: