Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

allow multipart messages to specify content-transfer-encoding on body and html payloads #29

Closed
mmerickel opened this Issue · 3 comments

3 participants

@mmerickel
Owner

Currently it's possible to specify the Content-Transfer-Encoding on an attachment, but the body and html keys are left alone. These keys are then simply forwarded on to an email.Message object. Without being able to specify your own encoding on the keys, the Python stdlib email package will base-64 encode the body or the html if it found to require a utf-8 charset. It would be nice if this were overridable such that the body or html were encoded using quoted-printable.

One possibility would be to allow the body and html keys to accept an Attachment object.

Crappy spam filters may score the message down because it doesn't know how to deal with the content.

Does anyone have thoughts on this issue?

@rkintzi

You can add following snippet to your __init__.py:

from email import charset
charset.add_charset('utf-8', charset.SHORTEST, charset.QP, 'utf-8')
charset.add_charset('utf8', charset.SHORTEST, charset.QP, 'utf8')
@rkintzi rkintzi referenced this issue from a commit in rkintzi/pyramid_mailer
@rkintzi rkintzi Try to fix two issues:
 * Issue #32 (Pylons#32)
 * Issue #29 (Pylons#29)
a060338
@rpatterson
Owner

When I try this with a latin-1 character in both the text/plain and text/html parts, it does get encoded quoted printable, see this repoze.sendmail commit: repoze/repoze.sendmail@96c11cf. I also tried this from pyramid_mailer and it also got quoted printable encoded when sent via SMTP. Can you provide a test case?

@rpatterson
Owner

@mmerickel clarified that this is only happening with utf-8 and I was only testing with latin-1

@rpatterson rpatterson closed this issue from a commit
@rpatterson rpatterson Allow setting Content-Transfer-Encoding for body and html via Attachm…
…ents:

Be warned that this may not work for utf-8 on some versions of Python
because of a bug in email.quiprimime: http://bugs.python.org/issue16948

Closes #29
b49bb60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.