async def handle_USER(self, server, session, username): session.db = DaoUser() session.user = POP3Model(dao_user=session.db).confirm_user(username) return f'+OK ({server.hostname}): {username}'
async def handle_TOP(self, server, session, which, top): return POP3Model().get_mail_body(session.user, which, top)
async def handle_QUIT(self, server, session): return POP3Model().del_mail(session)
async def handle_RETR(self, server, session, which): return POP3Model().get_mail_body(session.user, which)
async def handle_LIST(self, server, session, which): return POP3Model().get_mail_list(session.user, which)
async def handle_UIDL(self, server, session, which): return POP3Model().get_mail_uidl(session.user, which)
async def handle_STAT(self, server, session): count, size = POP3Model().get_mail_number_and_size(session.user) return f'+OK {count} {size}'
async def handle_PASS(self, server, session, username, password): POP3Model().login(session.user, password) return f'+OK welcome {username}'