Skip to content

Commit

Permalink
fix: ensure hard-coded denylist errors return 550
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Feb 27, 2025
1 parent 3808fa0 commit 81781b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helpers/get-error-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function getErrorCode(err) {

if (err.bounceInfo.category === 'virus') return 554;
if (err.bounceInfo.category === 'spam') return 550;
// hard-coded denylist errors have 550 while others have 421
if (err.name === 'DenylistError') return err.responseCode;
if (
(typeof err.responseCode !== 'number' || err.responseCode > 500) &&
(['defer', 'slowdown'].includes(err.bounceInfo.action) ||
Expand Down

0 comments on commit 81781b2

Please sign in to comment.