mxRaven webhook payloads describe inbound mail as JSON, and the full message
remains available as raw RFC 5322 bytes behind the payload's raw_email
reference. parseEmail turns those bytes into headers, addresses,
bodies, and decoded attachments; fetchAndParseRawEmail downloads,
verifies, and parses them in one step:
The parser is defensive: malformed messages yield the best available
interpretation instead of an error, and unknown charsets fall back to UTF-8
and then Latin-1. It understands multipart/mixed, multipart/alternative,
and multipart/related, decodes base64 and quoted-printable transfer
encodings, decodes RFC 2047 encoded words, and reassembles RFC 2231
parameters. message/rfc822 parts are surfaced as attachments rather than
parsed recursively. Only unbounded input — very deep nesting or thousands of
parts — is rejected.
Inbound email parsing for mxRaven deliveries.
mxRaven webhook payloads describe inbound mail as JSON, and the full message remains available as raw RFC 5322 bytes behind the payload's
raw_emailreference. parseEmail turns those bytes into headers, addresses, bodies, and decoded attachments; fetchAndParseRawEmail downloads, verifies, and parses them in one step:The parser is defensive: malformed messages yield the best available interpretation instead of an error, and unknown charsets fall back to UTF-8 and then Latin-1. It understands
multipart/mixed,multipart/alternative, andmultipart/related, decodesbase64andquoted-printabletransfer encodings, decodes RFC 2047 encoded words, and reassembles RFC 2231 parameters.message/rfc822parts are surfaced as attachments rather than parsed recursively. Only unbounded input — very deep nesting or thousands of parts — is rejected.