From 520dfd7b148e4b35e1300eb42c7ee02e10bc9763 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Tue, 2 Apr 2024 16:35:47 -0400 Subject: [PATCH] remove unused imports --- mail4one/pop3.py | 3 --- mail4one/server.py | 2 -- mail4one/smtp.py | 10 +++------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index f6bde47..e7db093 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -2,11 +2,8 @@ import asyncio import contextlib import contextvars import logging -import os import ssl -import uuid from dataclasses import dataclass -from hashlib import sha256 from pathlib import Path from .config import User from .pwhash import parse_hash, check_pass, PWInfo diff --git a/mail4one/server.py b/mail4one/server.py index 05e26c9..541d686 100644 --- a/mail4one/server.py +++ b/mail4one/server.py @@ -1,8 +1,6 @@ import asyncio import logging -import os import ssl -import sys from argparse import ArgumentParser from pathlib import Path from getpass import getpass diff --git a/mail4one/smtp.py b/mail4one/smtp.py index fad36ce..9c10bff 100644 --- a/mail4one/smtp.py +++ b/mail4one/smtp.py @@ -1,7 +1,5 @@ import asyncio -import io import logging -import mailbox import ssl import uuid import shutil @@ -13,11 +11,9 @@ from email.message import Message import email.policy from email.generator import BytesGenerator import tempfile -import random -from aiosmtpd.handlers import Mailbox, AsyncMessage -from aiosmtpd.smtp import SMTP, DATA_SIZE_DEFAULT -from aiosmtpd.smtp import SMTP as SMTPServer +from aiosmtpd.handlers import AsyncMessage +from aiosmtpd.smtp import SMTP from aiosmtpd.smtp import Envelope as SMTPEnvelope from aiosmtpd.smtp import Session as SMTPSession @@ -31,7 +27,7 @@ class MyHandler(AsyncMessage): self.mbox_finder = mbox_finder async def handle_DATA( - self, server: SMTPServer, session: SMTPSession, envelope: SMTPEnvelope + self, server: SMTP, session: SMTPSession, envelope: SMTPEnvelope ) -> str: self.rcpt_tos = envelope.rcpt_tos self.peer = session.peer