function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jhartjhart 

email services MIME-header decoding too strict

The Inbound Email object doesn't decode MIME-Header encoded subject lines if they use spaces (instead of underscores, as the spec demands).

So this subject line:

=?UTF-8?Q?My_Company=E2=84=A2?=

Will be received by Email Services and parsed correctly into "My Company™"

But the same subject line is not decoded if it uses a space instead of a _:

=?UTF-8?Q?My Company=E2=84=A2?=

So the Apex code that processes the email is presented with the encoded format, instead of the proper decoded content.


While this is strictly correct behavior per the spec (RFC 2047), it doesn't fit the real world.  In particular, GMail uses spaces instead of underscores ... so any email sent from GMail (or Google Apps) that has an encoded subject line won't be decoded by Email Servies.

Many other RFC 2047 decoders (eg, Perl's Encode::MIME::Header) are tolerant of spaces in the encoded-text.


(Salesforce support - I created case 02325915 to track this issue).


Message Edited by jhart on 12-25-2008 01:05 PM
Best Answer chosen by Admin (Salesforce Developers) 
jhartjhart
This has been fixed in Spring '09.

All Answers

jhartjhart
Note - salesforce has escalated this support case to a real bug.  I don't know what release will fix this.  From their support personnel:

As spoken briefly, tier 3 has identified as a bug and the bug report has been already created.

I am going to update the status of this case to "Bug Fix Submitted". I will let you know if I hear back on the status of the bug fix.

jhartjhart
This has been fixed in Spring '09.
This was selected as the best answer
fgwarb_devfgwarb_dev

Thank you for maintaining this log!