diff --git a/imap-core/lib/handler/imap-parser.js b/imap-core/lib/handler/imap-parser.js index 9d3200a6..24b33307 100644 --- a/imap-core/lib/handler/imap-parser.js +++ b/imap-core/lib/handler/imap-parser.js @@ -440,7 +440,7 @@ class TokenParser { throw new Error('Unexpected whitespace at position ' + (this.pos + i)); } - if (this.currentNode.value.substr(-1) === '*' && this.currentNode.value.substr(-2, 1) !== ':') { + if (this.currentNode.value !== '*' && this.currentNode.value.substr(-1) === '*' && this.currentNode.value.substr(-2, 1) !== ':') { throw new Error('Unexpected whitespace at position ' + (this.pos + i)); } diff --git a/lib/tools.js b/lib/tools.js index 98adb1b7..2aa5926b 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -276,7 +276,7 @@ function getEmailTemplates(tags, callback) { return entry.message; }) - .filter(entry => entry); + .filter(entry => entry && !entry.disabled); templates = newTemplates; return callback(null, templates.map(template => renderEmailTemplate(tags, template)));