marrow / mailer

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

immediate manager handles TransportExhaustedException as fail-in-progress exception when it is not #6

Closed namn closed 12 years ago

namn commented 12 years ago

The offended code is quoted:

try:
    result = self.transport.deliver(message)

except TransportExhaustedException:
    log.debug("Transport exhausted, retrying.")
    self.transport.shutdown()
    self.deliver(message)

TransportExhaustedException is raised after the message has been successfully sent and no further reusing of this Transport should be attempted. The immediate manager wrongly treats that exception as there was a problem in sending the message, let's try again.