title: Multiple Content-Type: text/html inside a multipart/mixed
body: <p>I am trying to parse emails and received the below message for a reply using Apple Mail.
  It's composed of a multipart/mixed containing an attachment and <strong>2</strong> html parts.</p>
  
  <p>In brief:</p>
  
  <pre><code>multipart/alternative
    \--&gt; text/plain
    \--&gt; multipart/mixed
           \--&gt; text/html
           \--&gt; multipart/alternative
           \--&gt; text/html (empty)
  </code></pre>
  
  <p>or with the email source:</p>
  
  <pre><code>From: "John Doe" &lt;john@example.com&gt;
  ... // some headers
  Content-Type: multipart/alternative;
   boundary="Apple-Mail=_9331E12B-8BD2-4EC7-B53E-01F3FBEC9227"
  Message-Id: &lt;6BB1FAB2-2104-438E-9447-07AE2C8C4A92@sexample.com&gt;
  Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
  ... // rest of headers
  
  --Apple-Mail=_9331E12B-8BD2-4EC7-B53E-01F3FBEC9227
  Content-Transfer-Encoding: 7bit
  Content-Type: text/plain;
      charset=us-ascii
  
  My message in text...
  
  
  --Apple-Mail=_9331E12B-8BD2-4EC7-B53E-01F3FBEC9227
  Content-Type: multipart/mixed;
   boundary="Apple-Mail=_CA6C687E-6AA0-411E-B0FE-F0ABB4CFED1F"
  
  
  --Apple-Mail=_CA6C687E-6AA0-411E-B0FE-F0ABB4CFED1F
  Content-Transfer-Encoding: 7bit
  Content-Type: text/html;
      charset=us-ascii
  
  &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;My message in HTML...&lt;/body&gt;&lt;/html&gt;
  
  --Apple-Mail=_CA6C687E-6AA0-411E-B0FE-F0ABB4CFED1F
  Content-Disposition: inline;
      filename=myfile.pdf
  Content-Type: application/pdf;
      name="myfile.pdf"
  Content-Transfer-Encoding: base64
  
  ... // base64 content
  
  
  --Apple-Mail=_CA6C687E-6AA0-411E-B0FE-F0ABB4CFED1F
  Content-Transfer-Encoding: 7bit
  Content-Type: text/html;
      charset=us-ascii
  
  &lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html charset=us-ascii"&gt;&lt;base&gt;&lt;/head&gt;&lt;body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"&gt;&lt;div&gt;&lt;blockquote type="cite"&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/body&gt;&lt;/html&gt;
  --Apple-Mail=_CA6C687E-6AA0-411E-B0FE-F0ABB4CFED1F--
  
  --Apple-Mail=_9331E12B-8BD2-4EC7-B53E-01F3FBEC9227--
  </code></pre>
  
  <p>Notice the last part being an empty <code>&lt;blockquote type="cite"&gt;&lt;/blockquote&gt;</code> (is it because it's a reply?).</p>
  
  <ul>
  <li>Is that valid two have two <code>Content-Type: text/html</code> in the same multipart ?</li>
  <li>Has the last (empty) part a meaning?</li>
  <li>Is it possible to have some actual text in additional text/html parts it or can I always ignore it when parsing? (or concatenate parts)</li>
  </ul>
  
  <p>Thanks</p>