From 1c5fc6f73ee6f0a9a157fcace21b69ad04b3bc8f Mon Sep 17 00:00:00 2001 From: niftylettuce Date: Wed, 12 Aug 2020 19:49:16 -0500 Subject: [PATCH] fix: catch edge case and bubble up detailed error rejection for tracing core issue --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 96ebda4..fd4c0b1 100644 --- a/index.js +++ b/index.js @@ -63,6 +63,17 @@ function authenticateMessage(message, ...args) { const result = { header: stdout.join('').trim().split('Authentication-Results: ')[1] }; + + // TODO: investigate thie edge case further and follow up with authheaders/dkimpy authors + if (!result.header) + return reject( + new Error( + `No Authentication-Results header was returned. Data: ${JSON.stringify( + { message, stdout, stderr } + )}` + ) + ); + for (const key of KEYS) { result[key] = {}; }