If a message is bigger than the V8 string length limit (Math.pow(2, 28), ~260mb) the parser will crash with following error:
node_modules/node-mbox/src/mbox.js:100
stream.emit('message', 'From ' + chunks.join(''));
^
RangeError: Invalid string length
at Array.join (native)
at SBMH.<anonymous> (node_modules/node-mbox/src/mbox.js:100:49)
at emitMany (events.js:146:13)
at SBMH.emit (events.js:223:7)
at SBMH._sbmh_feed (node_modules/streamsearch/lib/sbmh.js:159:14)
at SBMH.push (node_modules/streamsearch/lib/sbmh.js:56:14)
at MboxStream._transform (node_modules/node-mbox/src/mbox.js:119:17)
at MboxStream.Transform._read (_stream_transform.js:186:10)
at MboxStream.Transform._write (_stream_transform.js:174:12)
at doWrite (_stream_writable.js:387:12)
A potential mitigation strategy:
https://gist.github.com/tpreusse/bc2ccf6fc6bf4ff563cdd336c1728db2/revisions#diff-05028f8355c8d7379cb42b5feac6429f
(throw error by default, skip or emit partial via options)
However the ultimate solution would be create a new api which allows to stream junks (e.g. to mailparser) as they come in. mailparser can probably handle almost unlimited attachment sizes with its attachment streams.
If a message is bigger than the V8 string length limit (
Math.pow(2, 28), ~260mb) the parser will crash with following error:A potential mitigation strategy:
https://gist.github.com/tpreusse/bc2ccf6fc6bf4ff563cdd336c1728db2/revisions#diff-05028f8355c8d7379cb42b5feac6429f
(throw error by default, skip or emit partial via options)
However the ultimate solution would be create a new api which allows to stream junks (e.g. to
mailparser) as they come in.mailparsercan probably handle almost unlimited attachment sizes with its attachment streams.