diff --git a/index.js b/index.js index aa08106..1b018b1 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,13 @@ module.exports = (headers) => { if ('return-path' in headers && headers['return-path'] === '<>') { return true; } - if (headers['preference'] === 'auto_reply' || headers['preference'] === 'bulk' || headers['x-preference'] === 'auto_reply' || 'x-autorespond' in headers) { + if ('preference' in headers && headers['preference'].toLowerCase() === 'auto_reply') { + return true; + } + if ('x-precedence' in headers && headers['x-precedence'].toLowerCase() === 'auto_reply') { + return true; + } + if ('x-autorespond' in headers) { return true; } if ('x-autogenerated' in headers && ['forward', 'group', 'letter', 'mirror', 'redirect', 'reply'].includes(headers['x-autogenerated'].toLowerCase())) { diff --git a/test.js b/test.js index 0e59198..b974225 100644 --- a/test.js +++ b/test.js @@ -21,9 +21,9 @@ assert.ok(isAutoreply({ 'return-path': '<>' })); assert.ok(isAutoreply({ 'Preference': 'auto_reply' })); assert.ok(isAutoreply({ 'preference': 'auto_reply' })); assert.ok(!isAutoreply({ 'Preference': 'not_auto_reply' })); -assert.ok(isAutoreply({ 'X-Preference': 'auto_reply' })); -assert.ok(isAutoreply({ 'x-preference': 'auto_reply' })); -assert.ok(!isAutoreply({ 'X-Preference': 'not_auto_reply' })); +assert.ok(isAutoreply({ 'X-Precedence': 'auto_reply' })); +assert.ok(isAutoreply({ 'x-precedence': 'auto_reply' })); +assert.ok(!isAutoreply({ 'X-Precedence': 'not_auto_reply' })); // Test X-AutoRepsond header assert.ok(isAutoreply({ 'X-AutoRespond': '' }));