From 19e21606cd29ba57e0d05b5e01c9c3339fffce4e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 13 May 2009 20:52:51 +0000 Subject: [PATCH] Fix exception when timing out trying to send notification email --- deluge/ui/gtkui/notification.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/notification.py b/deluge/ui/gtkui/notification.py index c7d474197..dde78cb09 100644 --- a/deluge/ui/gtkui/notification.py +++ b/deluge/ui/gtkui/notification.py @@ -103,7 +103,12 @@ class Notification: port = 587 elif self.config["ntf_security"] == None: port = 25 - mailServer = smtplib.SMTP(self.config["ntf_server"], port) + try: + mailServer = smtplib.SMTP(self.config["ntf_server"], port) + except Exception, e: + log.error("There was an error sending the notification email: %s", e) + return + if self.config["ntf_username"] and self.config["ntf_pass"]: if self.config["ntf_security"] == 'SSL' or 'TLS': mailServer.ehlo('x')