From 6a3a9ea114417b344caeb88c0cd1c8921b67a1ff Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Thu, 25 Sep 2014 13:29:24 +0200 Subject: [PATCH] SMTP authentication uses bytes, not unicode, fixes #126 Encode configuration variables as ascii, ignoring non-ascii characters (Python's smtplib is not yet able to support the UTF8SMTP). --- CHANGES.rst | 3 ++- isso/ext/notifications.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ed11621..1291030 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog for Isso 0.9.7 (unreleased) ------------------ -- Nothing changed yet. +- fix SMTP authentication using CRAM-MD5 (incorrect usage of + `smtplib`), #126 0.9.6 (2014-08-18) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index cdddcea..46663bc 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -66,8 +66,8 @@ class SMTP(object): self.client.starttls(); if self.conf.get('username') and self.conf.get('password'): - self.client.login(self.conf.get('username'), - self.conf.get('password')) + self.client.login(self.conf.get('username').encode('ascii', errors='ignore'), + self.conf.get('password').encode('ascii', errors='ignore')) return self.client