nodemailer / mailparser

Decode mime formatted e-mails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Error: Max allowed child nodes exceeded" is thrown if you parse the email with more than 1000 Content

leoawesome opened this issue · comments

commented

mailparser version: 3.2.0

Problem statement:

  • The following error "Error: Max allowed child nodes exceeded" is thrown when I am trying to parse the email with more than 1000 Content. It parses correctly with a max of 1000 contents.

Sample IFFE function:

const { simpleParser } = require('mailparser');
const fs = require('fs').promises;

(async() => {
    try {
        const filename = 'olmo80tm5099ug4bu5smh600voflot5ko5lfjho1'; // email file which contain more than 1000 contents
        const data = await fs.readFile(filename, 'utf8');
        const email = await simpleParser(data);

        console.log(email);
    } catch (err) {
        console.log('err', err);
    }
    process.exit(1);
})();

Error message:

{ Error: Max allowed child nodes exceeded
    at MessageSplitter.processLine (/service/messaging/node_modules/mailsplit/lib/message-splitter.js:304:23)
    at Immediate.iterateData (/service/messaging/node_modules/mailsplit/lib/message-splitter.js:79:33)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5) code: 'EMAXLEN' }