jhermsmeier/node-envelope

envelope doesn't parse more than 1 attachment

MBR-0001 opened this issue · 2 comments

Emails sent from gmail with multiple attachments don't get parsed fully, only 1 of the attachments is "parsed"

Steps to reproduce

  1. Send an email with multiple attachments
  2. Parse it on the server

Code used

const envelope = require("envelope");
const fs = require("fs");

let parsed = envelope.parse(fs.readFileSync("./raw.txt"));

setInterval(() => {}, 1e6);

if (process.platform === "win32") {
    let r = require("readline").createInterface({
        input: process.stdin,
        output: process.stdout
    });

    r.on("line", line => {
        if (!line) return;

        try {
            let res = eval(line);
            console.log(res);
        }
        catch (ex) {console.log(ex);}        
    });
}
//allows easy inspection of the parsed email by just eval-ing stdin

Output

NtEjHNM.png

I can provide the "raw email" file if needed

Hey, thanks! A test email would be excellent - I currently don't have a whole lot of time on my hands, so having something to reliably reproduce would help a lot.