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: blank Content-Transfer-Encoding header causes exception

We are seeing some real-world emails that Email Services cannot handle, instead generating an error message:

 

554 Error processing email content Error ID=1753825505-222 (1527040629)

 

Emails that cause this error have a blank Content-Transfer-Encoding header in the text & html parts:

 

Date: Thu, 4 Apr 2013 19:32:24 -0400
MIME-Version: 1.0
Message-ID: <456cff6ec6ae70ac0bae49733e680ea3@dp1.example.com>
To: <to@example.com>
From: <from@example.com>
Subject: test subject
Content-Type: multipart/alternative;
	boundary="Alexandria=_d516e2a0981b50e1fbf77c61de0bd050"

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 

text body

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
html body
</body>
</html>

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050--

 

 

Email Services handles the email just fine if you simply remove the header:

 

Date: Thu, 4 Apr 2013 19:32:24 -0400
MIME-Version: 1.0
Message-ID: <456cff6ec6ae70ac0bae49733e680ea3@dp1.example.com>
To: <to@example.com>
From: <from@example.com>
Subject: test subject
Content-Type: multipart/alternative;
	boundary="Alexandria=_d516e2a0981b50e1fbf77c61de0bd050"

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050
Content-Type: text/plain; charset="utf-8"

text body

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050
Content-Type: text/html; charset="utf-8"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
html body
</body>
</html>

--Alexandria=_d516e2a0981b50e1fbf77c61de0bd050--

 

A minor bug, but Email Services should be able to handle almost any email that is "roughly valid".  The world of email is wild & wooly and full of messages that are nonconforming in minor ways like this, and Email Services should be ready to handle them.

 

 

Salesforce support: I have created case 09011561 to track this issue.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
jhartjhart
Salesforce R&D has accepted this as a bug and is working on a fix.

https://success.salesforce.com/issues_view?id=a1p30000000Szl4AAC

All Answers

jhartjhart

Note: an incorrect Content-Transfer-Encoding header will cause the exact same error.

 

So this will throw the same error:  (notice the dash in "8-bit"):

 

--6d0e979677a40211_6f2bd2b8c16b2136b
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: 8-bit

text body

But getting rid of the dash works fine:

 

--6d0e979677a40211_6f2bd2b8c16b2136b
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: 8bit

text body

While this sounds contrived, we actually see a couple examples of this per week.

jhartjhart
Salesforce R&D has accepted this as a bug and is working on a fix.

https://success.salesforce.com/issues_view?id=a1p30000000Szl4AAC
This was selected as the best answer