mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-03-02 02:45:40 +08:00
Fixes #32
This commit is contained in:
parent
498b96e0d6
commit
93857d4edb
4 changed files with 9 additions and 6 deletions
|
@ -216,7 +216,7 @@ module.exports = function(response, isLogging) {
|
|||
|
||||
let finalize = () => {
|
||||
if (node.partial) {
|
||||
resp += '<' + node.partial.join('.') + '>';
|
||||
resp += '<' + node.partial[0] + '>';
|
||||
}
|
||||
setImmediate(callback);
|
||||
};
|
||||
|
|
|
@ -370,7 +370,7 @@ class Indexer {
|
|||
|
||||
// remove attachments and very large text nodes from the mime tree
|
||||
if (!isMultipart && node.body && node.body.length && (!isInlineText || node.size > 300 * 1024)) {
|
||||
let attachmentId = 'ATT' + (++idcount).toString().padStart(5, '0');
|
||||
let attachmentId = 'ATT' + leftPad(++idcount, '0', 5);
|
||||
|
||||
let fileName =
|
||||
(node.parsedHeader['content-disposition'] &&
|
||||
|
@ -784,4 +784,8 @@ function textToHtml(str) {
|
|||
return text;
|
||||
}
|
||||
|
||||
function leftPad(val, chr, len) {
|
||||
return chr.repeat(len - val.toString().length) + val;
|
||||
}
|
||||
|
||||
module.exports = Indexer;
|
||||
|
|
|
@ -1364,7 +1364,7 @@ describe('IMAP Protocol integration tests', function() {
|
|||
},
|
||||
function(resp) {
|
||||
resp = resp.toString();
|
||||
expect(resp.indexOf('\n* 4 FETCH (BODY[]<4.5> {5}\r\n: sen)\r\n') >= 0).to.be.true;
|
||||
expect(resp.indexOf('\n* 4 FETCH (BODY[]<4> {5}\r\n: sen)\r\n') >= 0).to.be.true;
|
||||
expect(
|
||||
resp.indexOf(
|
||||
'\n* 4 FETCH (BODY[]<4> {93}\r\n: sender@example.com\r\nto: to@example.com\r\ncc: cc@example.com\r\nsubject: test\r\n\r\nHello World!\r\n)\r\n'
|
||||
|
|
|
@ -311,10 +311,9 @@ class FilterHandler {
|
|||
recipient,
|
||||
|
||||
targets: forwardTargets.size
|
||||
? Array.from(forwardTargets).map((row, i) => ({
|
||||
? Array.from(forwardTargets).map(row => ({
|
||||
type: row[1].type,
|
||||
value: row[1].value,
|
||||
seq: (i + 1).toString(16).padStart(3, '0')
|
||||
value: row[1].value
|
||||
}))
|
||||
: false,
|
||||
|
||||
|
|
Loading…
Reference in a new issue