diff --git a/src/piler-smtp.c b/src/piler-smtp.c index 7eade8d..5e024a7 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -206,12 +206,17 @@ n = epoll_wait(efd, events, cfg.max_connections, -1); for(i=0; i= _LOG_EXTREME) syslog(LOG_PRIORITY, "ERROR: the remote end hung up without sending QUIT"); - close(events[i].data.fd); + session = get_session_by_socket(sessions, cfg.max_connections, events[i].data.fd); + if(session) + tear_down_session(sessions, session->slot, &num_connections); + else + close(events[i].data.fd); continue; }