{ "name": "Email (EML)", "scopeName": "text.eml.basic", "patterns": [ { "include": "#addresses" }, { "include": "#headers" }, { "include": "#boundary" }, { "include": "#encodedWord" }, { "include": "#encodingTypes" }, { "include": "#uuid" }, { "include": "#base64" }, { "include": "#html" }, { "include": "#quote" }, { "include": "#ipv4" }, { "include": "#ipv6" } ], "repository": { "addresses": { "patterns": [ { "name": "meta.email-address.eml", "match": "(?x)\n((\") [-a-zA-Z0-9.\\x20+_]+ (\")) \\s*\n((\u003c) [-a-zA-Z0-9.]+@[-a-zA-Z0-9.]+ (\u003e))", "captures": { "1": { "name": "string.quoted.double.author-name.eml" }, "2": { "name": "punctuation.definition.string.begin.eml" }, "3": { "name": "punctuation.definition.string.end.eml" }, "4": { "name": "constant.other.author-address.eml" }, "5": { "name": "punctuation.definition.tag.begin.eml" }, "6": { "name": "punctuation.definition.tag.end.eml" } } }, { "name": "meta.email-address.eml", "match": "(?x)\n((\") [-a-zA-Z0-9.\\ +_]+ (\")) \\s*\n((\u0026lt;) [-a-zA-Z0-9.]+@[-a-zA-Z0-9.]+ (\u0026gt;))", "captures": { "1": { "name": "string.quoted.double.author-name.eml" }, "2": { "name": "punctuation.definition.string.begin.eml" }, "3": { "name": "punctuation.definition.string.end.eml" }, "4": { "name": "constant.other.author-address.eml" }, "5": { "name": "punctuation.definition.tag.begin.eml" }, "6": { "name": "punctuation.definition.tag.end.eml" } } }, { "name": "meta.email-address.eml", "match": "(?x)\n([-a-zZ-Z0-9.+_]+) \\s*\n(\u003c)([-a-zA-Z0-9.]+@[-a-zA-Z0-9.]+)(\u003e)", "captures": { "1": { "name": "string.unquoted.author-name.eml" }, "2": { "name": "punctuation.definition.tag.begin.eml" }, "3": { "name": "constant.other.author-address.eml" }, "4": { "name": "punctuation.definition.tag.end.eml" } } }, { "name": "meta.email-address.eml", "match": "(?x)\n([-a-zZ-Z0-9.+_]+) \\s*\n(\u0026lt;)([-a-zA-Z0-9.]+@[-a-zA-Z0-9.]+)(\u0026gt;)", "captures": { "1": { "name": "string.unquoted.author-name.eml" }, "2": { "name": "punctuation.definition.tag.begin.eml" }, "3": { "name": "constant.other.author-address.eml" }, "4": { "name": "punctuation.definition.tag.end.eml" } } }, { "match": "(\u0026lt;)([-a-zA-Z0-9.+_]+@[-a-zA-Z0-9.]+)(\u0026gt;)", "captures": { "1": { "name": "punctuation.definition.tag.begin.eml" }, "2": { "name": "constant.other.author-address.eml" }, "3": { "name": "punctuation.definition.tag.end.eml" } } }, { "match": "(\u003c)([-a-zA-Z0-9.+_]+@[-a-zA-Z0-9.]+)(\u003e)", "captures": { "1": { "name": "punctuation.definition.tag.begin.eml" }, "2": { "name": "constant.other.author-address.eml" }, "3": { "name": "punctuation.definition.tag.end.eml" } } } ] }, "base64": { "name": "text.eml.encoded", "match": "(?x) ^\n(?:[A-Za-z0-9+/]{4})+\n(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" }, "boundary": { "name": "meta.multi-part.chunk.eml", "begin": "^(--(?!\u003e).*)", "end": "^(?=\\1)", "patterns": [ { "name": "meta.embedded.html.eml", "contentName": "meta.embedded.html", "begin": "^(?i)(Content-Type:)\\s*(text/html(?=[\\s;+]).*)", "end": "^(?=--(?!\u003e))", "patterns": [ { "include": "#boundaryHeaders" }, { "include": "text.html.basic" } ], "beginCaptures": { "1": { "patterns": [ { "include": "#headers" } ] }, "2": { "patterns": [ { "include": "$self" } ] } } }, { "name": "meta.embedded.text.eml", "contentName": "markup.raw.html", "begin": "^(?i)(Content-Type:)\\s*((?!text/html(?=[\\s;+]))\\S+.*)", "end": "^(?=--(?!\u003e))", "patterns": [ { "include": "#boundaryHeaders" } ], "beginCaptures": { "1": { "patterns": [ { "include": "#headers" } ] }, "2": { "patterns": [ { "include": "$self" } ] } } }, { "include": "$self" } ], "beginCaptures": { "0": { "name": "keyword.control.boundary.eml" } } }, "boundaryHeaders": { "begin": "\\G", "end": "^(?=\\s*)$", "patterns": [ { "include": "$self" } ] }, "encodedWord": { "name": "keyword.control.encoded-word.eml", "match": "(?i)=\\?utf-8\\?B\\?(.*)\\?=" }, "encodingTypes": { "name": "keyword.operator.special.eml", "match": "(?xi)\n( base64\n| multipart\\/.*:\n| image\\/.*;\n| text\\/.*\n| boundary=.*\n)" }, "headers": { "match": "(?xi) ^\n( archived-at\n| cc\n| content-type\n| date\n| envelope-from\n| from\n| in-reply-to\n| mail-from\n| message-id\n| precedence\n| references\n| reply-to\n| return-path\n| sender\n| subject\n| to\n| x-cmae-virus\n| \\d*zendesk\\d*\n| [^:]*resent-[^:]*\n| x-[^:]*\n| [A-Z][a-zA-Z0-9-]*\n) (:)", "captures": { "1": { "name": "variable.header.name.eml" }, "2": { "name": "punctuation.separator.dictionary.key-value.colon.eml" } } }, "ipv4": { "name": "variable.other.ipv4.eml", "match": "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" }, "ipv6": { "name": "variable.other.eml", "match": "(?x)\n( ([0-9a-fA-F]{1,4}:){7} [0-9a-fA-F]{1,4}\n| ([0-9a-fA-F]{1,4}:){1,7} :\n| ([0-9a-fA-F]{1,4}:){1,6} :[0-9a-fA-F]{1,4}\n| ([0-9a-fA-F]{1,4}:){1,5} (:[0-9a-fA-F]{1,4}){1,2}\n| ([0-9a-fA-F]{1,4}:){1,4} (:[0-9a-fA-F]{1,4}){1,3}\n| ([0-9a-fA-F]{1,4}:){1,3} (:[0-9a-fA-F]{1,4}){1,4}\n| ([0-9a-fA-F]{1,4}:){1,2} (:[0-9a-fA-F]{1,4}){1,5}\n| [0-9a-fA-F]{1,4} :((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)\n| fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]+\n| ::(ffff(:0{1,4})?:)? ((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])\n| ([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])\n)" }, "quote": { "name": "markup.quote.line.eml", "begin": "^[|\u003e]", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.quote.eml" } } }, "uuid": { "name": "constant.other.uuid.eml", "match": "(?x)\n( [0-9a-fA-F]{32}\n| [0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}\n)" } } }