marrow / mailer

A light-weight, modular, message representation and mail delivery framework for Python.
MIT License
276 stars 62 forks source link

smtp transport does not reset self.sent #5

Closed namn closed 13 years ago

namn commented 13 years ago

It cannot be reused after exhaustion.

namn commented 13 years ago

Actually, the commit doesn't fix this issue, taking into account how the sent count is being used by immediate manager. The count reset should be done in connect_to_server, or the manager should call startup when it detects exhaustion. Currently, immediate manager does not call startup.

amcgregor commented 13 years ago

The count is internal to the SMTP transport and should never be utilized by a manager.

Updated to add: the description of the exception involves not re-calling startup after exhaustion, but rather utilization of a brand new instance. The above patch makes the immediate manager use the TransportPool context manager, which does this, and is now consistent across all managers.