Dispatching hundreds of emails simultaneously to the same destination corporate domain (e.g., 50 emails in one second to `@ibm.com`) triggers immediate ISP rate-limiting blocks (HTTP/SMTP `421 4.7.0 Try again later`). High-scale outreach systems enforce per-destination domain throttling using Redis token buckets.
1. Distributed Token Bucket Throttling
A distributed Redis Lua script enforces a strict maximum dispatch rate per receiving MX domain (e.g. 1 email every 120 seconds per target domain):
const THROTTLE_KEY = `throttle:domain:${targetDomain}`;
const isLocked = await redis.set(THROTTLE_KEY, 'active', 'NX', 'EX', 120);
if (!isLocked) {
// Re-queue message for delayed dispatch
await delayQueue.add(jobData, { delay: 125000 });
}