'When the connection is lost or cannot be established, prepare to
resend unsent messages and fire all deferred which are waiting for
the completion of the attempt to relay.
@type relay: L{SMTPManagedRelayerFactory}
@param relay: The factory for the relayer for the connection.'

def notifyDone(self, relay):

    for message in self.manager.managed.get(relay, ()):
        if self.noisy:
            log.msg((('Setting    ' + message) + '    waiting'))
        self.manager.queue.setWaiting(message)
    try:
        del self.manager.managed[relay]
    except KeyError:
        pass
    notifications = self._completionDeferreds
    self._completionDeferreds = None
    for d in notifications:
        d.callback(None)
