From 830ac2001e48b5cca5835d6a4b05c62914949a6f Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 8 Sep 2005 18:05:59 +0000 Subject: [PATCH] - Added more debug output if an error occurs when sending mail. Thanks to Stephen Gildea git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@190 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/mail.py b/utils/mail.py index 5781d89e..239d4e8e 100644 --- a/utils/mail.py +++ b/utils/mail.py @@ -64,8 +64,8 @@ class Mail: server.sendmail(self.fromAddr, self.toAddr, mail) logSys.debug("Email sent to " + `self.toAddr`) server.quit() - except Exception: + except Exception, e: logSys.error("Unable to send mail to " + self.host + ":" + `self.port` + " from " + self.fromAddr + " to " + - `self.toAddr`) + `self.toAddr` + ": " + `e` + ": " + `e.args`) \ No newline at end of file