diff --git a/aiosmtpd/smtp.py b/aiosmtpd/smtp.py index a977f751..42e5a0a1 100644 --- a/aiosmtpd/smtp.py +++ b/aiosmtpd/smtp.py @@ -461,7 +461,11 @@ def __init__( raise TypeError("command_call_limit must be int or Dict[str, int]") def _create_session(self) -> Session: - return Session(self.loop) + prev_session: Optional[Session] = getattr(self, 'session', None) + session = Session(self.loop) + if prev_session is not None: + session.proxy_data = prev_session.proxy_data + return session def _create_envelope(self) -> Envelope: return Envelope()