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).
This commit is contained in:
Martin Zimmermann 2014-09-25 13:29:24 +02:00
parent ad1fdfdb32
commit 6a3a9ea114
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,8 @@ Changelog for Isso
0.9.7 (unreleased) 0.9.7 (unreleased)
------------------ ------------------
- Nothing changed yet. - fix SMTP authentication using CRAM-MD5 (incorrect usage of
`smtplib`), #126
0.9.6 (2014-08-18) 0.9.6 (2014-08-18)

View File

@ -66,8 +66,8 @@ class SMTP(object):
self.client.starttls(); self.client.starttls();
if self.conf.get('username') and self.conf.get('password'): if self.conf.get('username') and self.conf.get('password'):
self.client.login(self.conf.get('username'), self.client.login(self.conf.get('username').encode('ascii', errors='ignore'),
self.conf.get('password')) self.conf.get('password').encode('ascii', errors='ignore'))
return self.client return self.client