parse message
This block is part of the mail group and was last modified in core v15.0.1.
parse message v15.0.1 Parses a raw RFC 822 / RFC 5322 message into addresses, subject, bodies, attachments and headers. Feed it the raw body of an inbound-mail webhook : http connection get raw body : or a stored .eml file.
- flow
flow - raw
valueThe raw message, headers and body, exactly as received.
- file
fileRead the raw message from a stored file instead of the
rawpin. Ignored whenrawis filled. - max attachment bytes
numberPer-part ceiling on decoded attachment content. A larger part keeps its metadata and is reported with
truncated: trueinstead of its bytes. - include content
conditionOn (the default) attachments carry
content_base64. Off gives name, type and size only : use it when you only need to list what came in. - trusted authentication results
valueThe
Authentication-Resultsvalue your own MTA produced, handed to the flow SEPARATELY from the message (for the mssgs mail pair: theX-Authentication-Resultsheader on themail/inboundcall, expanded from Exim's$authresults). When set it is the only source ofauthenticationand no header inside the message is read, so a header a sender wrote cannot be mistaken for the verifier's. Reported withsource: trusted. - authserv-id filter
valueWhen nothing came in through
authentication_results, only an in-messageAuthentication-Resultsheader whose authserv-id (its first token, e.g.mx1.mssgsmail.com) matches this is read, andReceived-SPFis not consulted. This is a FILTER, not authentication: a message header says nothing about who wrote it, so it is only as good as an ingress that always prepends its own header and strips inbound ones claiming its id (RFC 8601 §5). Such verdicts are reported withsource: message; a flow that needs certainty passes the verdict out of band instead.
- flow
flow - success
condition - error
value - message
object
Pure parser: reads one raw email and outputs a structured message object. No network, no store writes. message = { from {name,email}, to[], cc[], bcc[], reply_to[], subject, date (epoch ms, null when missing or unparseable), message_id (angle brackets stripped, null when absent), in_reply_to, references[], text, html, attachments[{name,content_type,size,content_base64,inline,cid}], headers (lowercased name -> string, or an array of strings for a header that repeats), size, spam_score, authentication {dkim,spf,dmarc} }. authentication is reported, not verified: with authserv_id set only the Authentication-Results header written by that verifier is believed and Received-SPF is ignored; empty believes the first header. text is derived from the HTML when the message carries no text/plain part; html is null for a text-only message. Handles nested multipart, base64 and quoted-printable, RFC 2047 encoded words, RFC 2231 filenames, and UTF-8 / ISO-8859-1 / ISO-8859-15 / windows-1252 charsets. A message/rfc822 sub-part is kept whole as one attachment. Garbage in never panics: a truncated or binary body parses as far as it can and reports success=false with a message on error rather than failing the flow.
email |
rfc822 |
eml |
mime |
inbound |
A typical wiring for parse message: a function trigger starts the flow; the flow out pin feeds debug.
Version history
Introduced in v15.0.1.
Back to
mail Return to the main group to view all sub-groups Back to mail Return to the group to view all blocks within this group 