From 35a9739ec5647485c6267c917ac328a4d7d67dae Mon Sep 17 00:00:00 2001 From: ikkemaniac Date: Thu, 17 Jan 2013 21:36:08 +0100 Subject: [PATCH] Improve debugging for email notifications --- couchpotato/core/notifications/email/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/notifications/email/main.py b/couchpotato/core/notifications/email/main.py index 0194ade7..6c957227 100644 --- a/couchpotato/core/notifications/email/main.py +++ b/couchpotato/core/notifications/email/main.py @@ -29,18 +29,23 @@ class Email(Notification): try: # Open the SMTP connection, via SSL if requested + log.debug("SMTP over SSL %s", ("enabled" if ssl == 1 else "disabled")) mailserver = smtplib.SMTP_SSL(smtp_server) if ssl == 1 else smtplib.SMTP(smtp_server) # Check too see if an login attempt should be attempted if len(smtp_user) > 0: + log.debug("Loggin in on SMTP server using username \'%s\'%s", (smtp_user, " and password" if len(smtp_pass) > 0 else "")) mailserver.login(smtp_user, smtp_pass) # Send the e-mail + log.debug("Sending the email") mailserver.sendmail(from_address, to_address, message.as_string()) # Close the SMTP connection mailserver.quit() - log.info('Email notifications sent.') + + log.info('Email notification sent') + return True except: log.error('E-mail failed: %s', traceback.format_exc())