Agent Wranglers

EML-77Recommended

Slow down per receiving provider when it defers mail

Cap connections and messages per hour to each receiving provider, and cut that rate when it answers with temporary 4xx errors. Raise it again only after an hour without them.

How to do it

Gmail, Microsoft and Yahoo each limit how fast they accept mail from one sender, and answer 421 or 451 when you go over. Pushing on makes them defer more and lowers your reputation. Group recipients by the provider behind their MX, not by domain, since thousands of domains use Google or Microsoft. Keep a send rate per provider, such as messages per minute and open connections. Halve it after a burst of deferrals, and raise it by a small step each quiet hour. Retry the deferred mail as Retry with backoff and give up in time says. If you use a sending service, it does this for you, so check its settings.

Examples

JavaScript example

export function nextRate(current, deferralsLastMinute, { floor = 10, step = 10 } = {}) {
  if (deferralsLastMinute >= 5) return Math.max(floor, Math.floor(current / 2));
  return current + step;
}

Python example

def next_rate(current: int, deferrals_last_minute: int, floor: int = 10, step: int = 10) -> int:
    if deferrals_last_minute >= 5:
        return max(floor, current // 2)
    return current + step

How to check

A test feeds the sender 20 421 4.7.0 replies from one provider within a minute. The rate for that provider halves and other providers keep their rate. The send log shows no hour with more messages to one provider than its cap.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/deliverability/per-receiver-throttling">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.