magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Don't encode email subject if not necessary. #45

Closed colinmollenhour closed 12 years ago

colinmollenhour commented 12 years ago

A couple reasons:

  1. It makes it hard to read when debugging, or if viewing the raw email headers, or in some client that is not smart enough to decode the subject (yes, there are a few).
  2. I've seen a spamassassin rule that dings an email if the subject is unnecessarily encoded.

So the solution would be to use a method to detect if the subject has non-ascii characters and not encode it if it doesn't.

magento-team commented 12 years ago

@colinmollenhour Message subject is encoded in accordance with the RFC 2047 section 5 "Use of encoded-words in message headers":

An 'encoded-word' may appear in a message header or body part header according to the following rules:

(1) An 'encoded-word' may replace a 'text' token (as defined by RFC 822) in any Subject or Comments header field, any extension message header field, or any MIME body part field for which the field body is defined as '*text'.

SpamAssassin rule, which dings an email if the subject is unnecessarily encoded, does not comply with the RFC 2047 section 6.1 "Recognition of 'encoded-word's in message headers".

It's essential for debugging to access data "as is", whether it's encoded or not.

Closing the ticket as "won't fix".