pop3 catch and log exceptions

This commit is contained in:
Balakrishnan Balasubramanian 2023-06-22 00:31:05 -04:00
parent 32d5d3d557
commit 1e6655a715

View File

@ -350,11 +350,14 @@ def make_pop_server_callback(mails_path: Path, users: list[User],
c_state.set(
State(reader=reader, writer=writer, ip=ip, req_id=scfg.next_id()))
logger.info(f"Got pop server callback")
try:
try:
return await asyncio.wait_for(start_session(), timeout_seconds)
finally:
writer.close()
await writer.wait_closed()
except:
logger.exception("unexpected exception")
return session_cb