Skip to content

Commit

Permalink
fix: added generic warm up spam > blocklist detection
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Dec 11, 2024
1 parent 944c29f commit 6bb0af4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion helpers/get-bounce-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ function getBounceInfo(err) {
// 421-4.7.28 Gmail has detected an unusual rate of unsolicited mail originating
// 421-4.7.28 from your SPF domain [fe-bounces.somedomain.com]
if (
response.includes(IP_ADDRESS) ||
response.includes('IP address') ||
response.includes('from your SPF domain') ||
response.includes('from your IP Netblock')
Expand Down Expand Up @@ -286,7 +287,10 @@ function getBounceInfo(err) {
// <https://sender.office.com/> <-- submit request here
// <https://sendersupport.olc.protection.outlook.com/pm/>
bounceInfo.category = 'blocklist';
} else if (response.includes('unusual rate of mail')) {
} else if (
response.includes('unusual rate of mail') &&
!response.includes(IP_ADDRESS)
) {
bounceInfo.category = 'spam';
//
// dmarc failures shouldn't occur since we check them on our side
Expand All @@ -307,6 +311,12 @@ function getBounceInfo(err) {
else if (['virus', 'spam'].includes(bounceInfo.category))
bounceInfo.action = 'reject';

//
// safeguard in case IP warmup
//
if (bounceInfo.category === 'spam' && response.includes(IP_ADDRESS))
bounceInfo.category = 'blocklist';

return bounceInfo;
}

Expand Down

0 comments on commit 6bb0af4

Please sign in to comment.