Piotr F. Mieszkowski
b6bd36a460
smtplib.SMTP expects ASCII-only message bodies when message body is provided as a 'str'. If we pass a 'bytes', we need to choose encoding earlier and we do this by calling 'as_bytes' on messages with SMTP policy, which takes care of formatting the body properly. As a result, ISO-8859-x messages are converted to Quoted Printable and UTF-8 messages are Base64-encoded. Testing this behaviour is tricky, because we use the same SMTP client to send test data. For this reason, test code has become a bit ugly, but it does exactly what we need. |
||
---|---|---|
.. | ||
certs | ||
keyhome | ||
keys | ||
modules | ||
msgin | ||
utils | ||
daemon_test.py | ||
e2e.ini | ||
e2e_test.py | ||
gpg-lacre-log.ini | ||
gpg-mailgate-cron-test.conf | ||
gpg-mailgate-daemon-test.conf | ||
sample.ini |