Closed arunrreddy closed 3 years ago
Could you, please, share an example of such message?
It has some sensitive info. Can I send it over mail?
Got it! Thanks. Will work on the issue tomorrow.
ok cool. Thanks a ton.
Since headers are failed to being passed sometimes, this could be a good strategy if the existing logic ends in an error. If a header name is found on a specific line and the header value condition check fails, search the immediate next line for a value and capture that as the header value, otherwise throw any error.
Patch published with version 0.0.4.
Tried 0.0.4 version. Getting the same error still. It fails to parse the below lines.
Date: Fri, 30 Oct 2020 19:28:52 +0000 Message-ID: DM5PR03MB32105C813B31150ED43297499B150@DM5PR03MB3210.namprd03.prod.outlook.com References: 01000175757e79fd-1e262982-ff5a-4ace-b0c6-267c0d2a12cf-000000@email.amazonses.com In-Reply-To: 01000175757e79fd-1e262982-ff5a-4ace-b0c6-267c0d2a12cf-000000@email.amazonses.com
I can see that there is a space before the three keys on the new line as well.
The raw email you've sent me parses just fine on 0.0.4. (Saved it to file, read using readFileSync and parsed using letterparser.parse()).
Still failing with the below error. "err":{"message":"Unexpected space at the beginning of line 51","name":"Error","stack":"Error: Unexpected space at the beginning of line 51\n at parseHeaders (/root/workspace/example-api/node_modules/letterparser/lib/parser.js:95:23)\n at Object.parseBody (/root/workspace/example-api/node_modules/letterparser/lib/parser.js:135:21)\n at parse (/root/workspace/example-api/node_modules/letterparser/lib/index.js:32:30)\n
I am unable to parse emails from outlook. This is the stack trace for the corresponding.
Error: Unexpected space at the beginning of line 51 at parseHeaders (/home/example/node_modules/letterparser/lib/parser.js:95:23) at Object.parseBody (/home/example/node_modules/letterparser/lib/parser.js:135:21) at parse (/home/example/node_modules/letterparser/lib/index.js:32:30)