is-autoreply
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -40,5 +40,11 @@ | ||
} | ||
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())) { | ||
@@ -45,0 +51,0 @@ return true; |
{ | ||
"name": "is-autoreply", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Detect if email is an autoreply according to the email headers.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,5 +24,5 @@ | ||
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' })); | ||
@@ -29,0 +29,0 @@ // Test X-AutoRepsond header |
10709
161