When an email containing a .eml or .msg file attachment is sent to an Email-to-Case routing address in Salesforce, the platform may generate additional .txt and .html attachment records alongside the original .eml file. This article explains why this occurs, how Salesforce Email-to-Case processes nested email MIME types, and how file naming is determined based on the original email headers.
When an email containing a .eml or .msg attachment is processed by the Salesforce Email-to-Case service, the platform's behavior depends on the Content-Type header of the attached file, as set by the originating email client.
When the attached .eml file has a Content-Type header value of "message/rfc822", Salesforce Email-to-Case identifies it as a nested email object (RFC 822 is the standard format for Internet email messages). The service then parses the nested email into its component parts and creates separate child attachment records. This typically results in three attachments:
When the Content-Disposition header includes a filename attribute, Salesforce uses that filename as the base for all generated attachments.
Example headers:
Content-Type: message/rfc822
Content-Disposition: attachment; filename="Testemail.eml"
Resulting attachments:
When the Content-Disposition header does not include a filename attribute, Salesforce uses the subject line of the received email as the base name for the .txt and .html files, and generates a default name for the .eml file.
Example headers:
Content-Type: message/rfc822; subject name="Welcome to your new Outlook.com account (1).eml"
Content-Disposition: attachment; creation-date="Mon, 22 Sep 2025 11:12:38 GMT"
Resulting attachments:
This behavior is by design. The Salesforce Email-to-Case service uses MIME type-aware processing logic to parse nested email objects (Content-Type: message/rfc822) into their component parts. The generation of multiple attachment records is not an error — it is a feature of the platform's email processing architecture.
005101786

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.