v1.15.1. Do not throw when VERP message parsing fails

This commit is contained in:
Andris Reinman 2016-08-22 15:06:11 +03:00
parent ef4aa301ab
commit 175b8eb94d
2 changed files with 13 additions and 6 deletions

View file

@ -74,7 +74,14 @@ let server = new SMTPServer({
let body = Buffer.concat(chunks, chunklen).toString();
let bh = new BounceHandler();
let bounceResult = [].concat(bh.parse_email(body) || []).shift();
let bounceResult;
try {
bounceResult = [].concat(bh.parse_email(body) || []).shift();
} catch (E) {
log.error('Bounce', 'Failed parsing bounce message');
log.error('Bounce', JSON.stringify(body));
}
if (!bounceResult || ['failed', 'transient'].indexOf(bounceResult.action) < 0) {
return callback(null, 'Message accepted');