Skip to content

Commit

Permalink
Mail server can refuse the send which throws an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
zedshaw committed Feb 27, 2013
1 parent e3817e4 commit 1276a64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lamson/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ def deliver(self, message, To=None, From=None):
logging.exception("Failed to connect to host %s:%d" % (hostname, self.port))
return

relay_host.sendmail(sender, recipient, str(message))
try:
relay_host.sendmail(sender, recipient, str(message))
except:
logging.exception("Failed to send message to host %s:%s" % (hostname, self.port))

relay_host.quit()

def resolve_relay_host(self, To):
Expand Down

0 comments on commit 1276a64

Please sign in to comment.