parse-multipart-mixed-mail-pmb
v0.1.4
Published
Split a 'Content-Type: multipart/mixed' email into parsed headers and body parts.
Downloads
3
Maintainers
Readme
parse-multipart-mixed-mail-pmb
Split a 'Content-Type: multipart/mixed' email into parsed headers and body parts.
API
This module exports one function, which carries another function:
parseMail(raw[, opt])
raw
should be a Buffer or "binary" (latin-1) String.
Its API is the same as splitParseHeaders()
from
parse-mail-attachment-pmb,
except that body
will be an array of raw body parts as produced by
.splitBody()
.
Use splitParseHeaders()
or parseAttachment()
to process them further.
opts
is an optional options object that supports these keys:
acceptJustText
(default:false
): If truthy, and the Content-Type starts withtext/
, rather than lamenting that it's not a multipart mail, consider the entire mail as its first (and only) body part.
.splitBody(raw)
raw
should be a Buffer or "binary" (latin-1) String.
Split just the body parts, and return them, as an array of Buffers.
Assumes the first line of raw
is a boundary.
Known issues
- Needs more/better tests and docs.
License
ISC