diff --git a/lib/yapople.js b/lib/yapople.js index 11ce2cb..f5d648e 100644 --- a/lib/yapople.js +++ b/lib/yapople.js @@ -158,7 +158,7 @@ function onData(data) { if (typeof this.flow !== 'undefined') { // for first and all next data chunks this.flow = Buffer.concat([this.flow, data]); // append chunk to buffer - if (this._command.cmd === state.RETR && sData.slice(-5) !== '\r\n.\r\n') return; + if (this._command.cmd === state.RETR && this.flow.slice(-5).toString() !== '\r\n.\r\n') return; if ( this.flow.slice(this.flow.length - 3).toString() === '.\r\n' || sData.substr(-3) === '.\r\n' diff --git a/package.json b/package.json index 64d7941..016f899 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yapople", - "version": "0.4.8", + "version": "0.4.9", "author": "Andrew D.Laptev ", "description": "Yet another POP3 library", "main": "lib/yapople.js",