'Generate a bounce message for a message which cannot be relayed.
@type relay: L{SMTPManagedRelayerFactory}
@param relay: The factory for the relayer responsible for the message.
@type message: L{bytes}
@param message: The path of the file holding the message.'

def notifyFailure(self, relay, message):

    if self.noisy:
        log.msg(('could    not    relay    ' + message))
    message = os.path.basename(message)
    with self.manager.queue.getEnvelopeFile(message) as fp:
        (from_, to) = pickle.load(fp)
    (from_, to, bounceMessage) = bounce.generateBounce(open((self.manager.queue.getPath(message) + '-D')), from_, to)
    (fp, outgoingMessage) = self.manager.queue.createNewMessage()
    with fp:
        pickle.dump([from_, to], fp)
    for line in bounceMessage.splitlines():
        outgoingMessage.lineReceived(line)
    outgoingMessage.eomReceived()
    self._finish(relay, self.manager.queue.getPath(message))
