Opened 9 years ago

Closed 6 years ago

#3472 closed (fixed)

Convince send_mail to not base64-encode the email

Reported by: Matthias Urlichs <smurf@…> Owned by: adrian
Component: Core (Mail) Version: master
Severity: Keywords: base64, send_mail
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you use utf8, mails will be base64-encoded by Python. That is a Bad Idea.

This patch tells it not to do that.

Attachments (2)

email-as-qp.patch (1.9 KB) - added by Matthias Urlichs <smurf@…> 9 years ago.
Use quoted-printable, not base64, when mailing
email-as-qp.2.patch (379 bytes) - added by smurf@… 9 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Matthias Urlichs <smurf@…>

Use quoted-printable, not base64, when mailing

Changed 9 years ago by smurf@…

comment:1 Changed 9 years ago by smurf@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Better patch: just replace the standard utf-8 charset.

The Subject: line seems to still be needlessly quoted-printable-encoded; I'll have to see what I can do about that. :-/

comment:2 Changed 9 years ago by Simon G. <dev@…>

  • Keywords send_mail added
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 9 years ago by jacob

Can you explain to be *why* this change is needed? I don't like checking in code I don't understand :)

comment:4 Changed 9 years ago by smurf@…

  • It blows up the mail for no good reason. Some people still have to watch their bandwidth...
  • Many mail filters frequently don't MIME-decode emails.
  • SpamAssassin and other filters assign a high score to base64-encoded mail, especially if the content is ASCII, because spammers use it to circumvent filters.

Reason enough? ;-)

comment:5 Changed 8 years ago by chris h.

I'd second the vote to add this patch... we ran into an issue with a vendor consuming our e-mail and not being able to decode the message even though other e-mail clients like GMail and Lotes Notes were fine with it.

comment:6 Changed 8 years ago by nick.lane.au@…

Perhaps the mime encoding type should be configured in the settings. Quoted-printable might not be the best choice for non-latin languages, while base64 may cause spam filter issues.

There is a ticket discussing this issue on trac's trac.

comment:7 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [5143]) Fixed #3472 -- Don't BASE64-encode UTF-8 (or ASCII) email messages.
Patch from smurf@….

comment:8 Changed 6 years ago by phr

  • Resolution fixed deleted
  • Status changed from closed to reopened

BTW, there's even better way to avoid unnecessary encoding:

from email import Charset 
Charset.add_charset('utf-8',Charset.SHORTEST,None,'utf-8')

The above will set Content-Transfer-Encoding to 7bit
or 8bit as needed - exactly as Mutt or Thunderbird do.

comment:9 Changed 6 years ago by Alex

  • Resolution set to fixed
  • Status changed from reopened to closed

Please don't reopen tickets closed by core developers (especially ones closed 2 years ago), if you think this is still an issue file a *new* bug.

Note: See TracTickets for help on using tickets.
Back to Top