From 3d505e7fb4028fe7d12dd6db617230ee023f8815 Mon Sep 17 00:00:00 2001 From: icegreg Date: Wed, 15 Jul 2015 13:40:08 +0300 Subject: [PATCH] fix smtp hmac doesn't like unicode password string --- dbmail/backends/mail.py | 2 +- dbmail/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbmail/backends/mail.py b/dbmail/backends/mail.py index 8f9ed82..afab24e 100644 --- a/dbmail/backends/mail.py +++ b/dbmail/backends/mail.py @@ -70,7 +70,7 @@ def _insert_mailer_identification_head(self): def _get_connection(self): if self._template.auth_credentials: return self._kwargs.pop('connection', None) or get_connection( - **self._template.auth_credentials) + **self._template.from_email.get_auth()) return self._kwargs.pop('connection', None) def _get_template(self): diff --git a/dbmail/models.py b/dbmail/models.py index 00a225a..69ade02 100644 --- a/dbmail/models.py +++ b/dbmail/models.py @@ -98,8 +98,8 @@ def get_auth(self): return dict( host=self.credential.host, port=self.credential.port, - username=self.credential.username, - password=self.credential.password, + username=str(self.credential.username), + password=str(self.credential.password), use_tls=self.credential.use_tls, fail_silently=self.credential.fail_silently )