       (?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
     """
 
+  # Multipart MIME boundary
+  boundary:
+    name:  'meta.multi-part.chunk.eml'
+    begin: '^(--(?!>).*)'
+    end:   '^(?=\\1)'
+    beginCaptures:
+      0: name: 'keyword.control.boundary.eml'
+    patterns: [{
+      # Content-Type: text/html;
+      name:  "meta.embedded.html.eml"
+      begin: "^(?i)(Content-Type:)\\s*(text/html(?=[\\s;+]).*)"
+      end:   "^(?=--(?!>))"
+      patterns: [
+        {include: "#boundaryHeaders"}
+        {include: 'text.html.basic'}
+      ]
+      contentName: "meta.embedded.html"
+      beginCaptures:
+        1: patterns: [include: "#headers"]
+        2: patterns: [include: "$self"]
+    },{
+      # Plain text (no header highlighting)
+      name:  "meta.embedded.text.eml"
+      begin: "^(?i)(Content-Type:)\\s*((?!text/html(?=[\\s;+]))\\S+.*)"
+      end:   "^(?=--(?!>))"
+      contentName: "markup.raw.html"
+      beginCaptures:
+        1: patterns: [include: "#headers"]
+        2: patterns: [include: "$self"]
+      patterns: [include: "#boundaryHeaders"]
+    },{
+      # Other headers unrelated to content-type
+      include: "$self"
+    }]
+
+  # Additional headers following Content-Type, but before body 
+  boundaryHeaders:
+    begin: "\\G"
+    end: "^(?=\\s*)$"
+    patterns: [include: "$self"]
 
   # Header fields
   headers:

    name: 'keyword.control.encoded-word.eml'
    match: '(?i)=\\?utf-8\\?B\\?(.*)\\?='

  # Content-Type: text/html;
  html:
    name:  "meta.embedded.html.eml"
    begin: "(?i)^(?=<html[\\s>])"
    end:   "(?<=</html>)"
    patterns: [include: 'text.html.basic']

  # IPv4
  ipv4:
    name: 'variable.other.ipv4.eml'

      0: name: "punctuation.definition.comment.quote.eml"

  # Specials
  encodingTypes:
    name: 'keyword.operator.special.eml'
    match: """(?xi)
      ( base64
      | multipart\\/.*:
      | image\\/.*;
      | text\\/.*
      | boundary=.*
      )
    """

  # UUID
  uuid:
