[1.6.x] Fixed #21093 -- Ensured that mails are not base64 encoded on python 3.3.3+.

Thanks to Arfrever for the report and Aymeric for the review.

Backport of f28ea0230846c81e9b6725454bb3a10df24678aa from master.
[1.6.x] Worked around a bug in python 3.3.3. Refs #21093

Backport of 280c1a65ccacd679bf298bf2b169ff01e7266b8e from master.