diff --git a/imap-core/lib/indexer/indexer.js b/imap-core/lib/indexer/indexer.js index b8507148..91e64b7b 100644 --- a/imap-core/lib/indexer/indexer.js +++ b/imap-core/lib/indexer/indexer.js @@ -80,12 +80,13 @@ class Indexer { next(); }; - root = false; - if (node.size || node.attachmentId) { - append(false, true); // force newline + if (!root) { + append(false, true); // force newline + } size += node.size; } + root = false; if (node.boundary) { append('--' + node.boundary); diff --git a/imap-core/lib/length-limiter.js b/imap-core/lib/length-limiter.js index b21bf417..08a19335 100644 --- a/imap-core/lib/length-limiter.js +++ b/imap-core/lib/length-limiter.js @@ -37,7 +37,7 @@ class LengthLimiter extends Transform { if (this.byteCounter < this.startFrom) { // split the chunk and ignore the first part chunk = chunk.slice(this.startFrom - this.byteCounter); - this.byteCounter += (this.startFrom - this.byteCounter); + this.byteCounter += this.startFrom - this.byteCounter; } // can emit full chunk @@ -69,7 +69,6 @@ class LengthLimiter extends Transform { } done(); } - } module.exports = LengthLimiter;