Correction de l'envoi de mot de passe par mail

darcs-hash:20070609081715-d1718-51e2660bc7c8c1d2c23a5edde77ff5fc7b623d79.gz
This commit is contained in:
bernat 2007-06-09 10:17:15 +02:00
parent 1f87db25cc
commit 43e632911c

View file

@ -76,6 +76,13 @@ def sendmail(request, to, subject, text, **kw):
charset.body_encoding = QP charset.body_encoding = QP
msg.set_charset(charset) msg.set_charset(charset)
#### HACK BACKPORT
# work around a bug in python 2.4.3 and above:
msg.set_payload('=')
if msg.as_string().endswith('='):
text = charset.body_encode(text)
#### FIN DU HACK
msg.set_payload(text) msg.set_payload(text)
# Create message headers # Create message headers