node-envelope icon indicating copy to clipboard operation
node-envelope copied to clipboard

envelope doesn't parse more than 1 attachment

Open MBR-0001 opened this issue 4 years ago • 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

MBR-0001 avatar Nov 23 '20 15:11 MBR-0001

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.

jhermsmeier avatar Nov 25 '20 18:11 jhermsmeier

Here's the raw file https://cdn.mbr.pw/bu4ZHba.txt

MBR-0001 avatar Nov 25 '20 19:11 MBR-0001