mailparser
Advanced tools
Comparing version 2.7.2 to 2.7.3
@@ -499,17 +499,2 @@ 'use strict'; | ||
let decoder = node.getDecoder(); | ||
if ( | ||
(/^text\//.test(contentType) && node.flowed) || | ||
(node.root && encoding === 'base64' && node.flowed) // Handle emails with base64 encoded root node | ||
) { | ||
let flowDecoder = decoder; | ||
decoder = new FlowedDecoder({ | ||
delSp: node.delSp, | ||
encoding: newNode.encoding, | ||
Iconv: this.options.Iconv | ||
}); | ||
flowDecoder.on('error', err => { | ||
decoder.emit('error', err); | ||
}); | ||
flowDecoder.pipe(decoder); | ||
} | ||
decoder.on('end', () => { | ||
@@ -803,2 +788,14 @@ this.decoderEnded = true; | ||
if (node.node.flowed) { | ||
let contentStream = node.contentStream; | ||
let flowDecoder = new FlowedDecoder({ | ||
delSp: node.node.delSp | ||
}); | ||
contentStream.on('error', err => { | ||
flowDecoder.emit('error', err); | ||
}); | ||
contentStream.pipe(flowDecoder); | ||
node.contentStream = flowDecoder; | ||
} | ||
let charset = node.charset || 'utf-8'; | ||
@@ -809,7 +806,8 @@ //charset = charset || 'windows-1257'; | ||
try { | ||
let contentStream = node.contentStream; | ||
let decodeStream = this.decoder.decodeStream(charset); | ||
node.contentStream.on('error', err => { | ||
contentStream.on('error', err => { | ||
decodeStream.emit('error', err); | ||
}); | ||
node.contentStream.pipe(decodeStream); | ||
contentStream.pipe(decodeStream); | ||
node.contentStream = decodeStream; | ||
@@ -816,0 +814,0 @@ } catch (E) { |
{ | ||
"name": "mailparser", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"description": "Parse e-mails", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
58248
1091