Sub topic 3
Spam traps, bounces, and abandoned addresses
This chapter assumes you know what a bounce and an unsubscribe are, and how mail moves from your email service provider (ESP) to a recipient's mailbox provider. It also assumes you can read basic SQL and Python. The previous chapters covered how mailbox providers score senders. This chapter covers a narrower question: which addresses on your list are dangerous because of what they are, not only because of how their owners behave.
Why this chapter matters for sunsetting
An inactive subscriber is often a person who stopped caring. Some inactive addresses are no longer people at all. They are abandoned mailboxes, typos, or addresses a provider has turned into a trap. Sending to them gives you no revenue, and it can damage your reputation faster than sending to bored humans.
Engagement scoring finds the bored humans. Bounce handling and trap awareness find the dead addresses. A sunset policy needs both, because the two groups call for different responses.
Three kinds of problem addresses
These categories overlap in practice, but each has a different cause and a different fix.
| Category | What it is | How you see it | Typical response |
|---|---|---|---|
| Hard-bouncing address | Mailbox or domain does not exist | Permanent SMTP failure, such as 5.1.1 | Suppress immediately |
| Soft-bouncing address | Temporary failure such as a full mailbox or server outage | Temporary failure, such as 4.2.2 | Retry, then suppress after repeated failures |
| Spam trap | Address run by a provider or blocklist operator to catch poor list practices | Usually nothing. Mail is accepted silently | Prevent by list hygiene. You cannot identify one directly |
| Abandoned address | Real mailbox the owner no longer reads | No bounce, no engagement | Re-engage, then sunset |
Bounces: the loud signal
A bounce is a failure notice for a message the receiving server would not accept. Receiving servers answer with an SMTP reply code. Most modern servers also include an enhanced status code with three numbers, such as 5.1.1.
The first number is the class:
2means success.4means a temporary failure. The sender may retry.5means a permanent failure. The sender should not retry.
The second and third numbers give the subject and detail. 5.1.1 means the destination mailbox does not exist. 5.1.2 means the destination domain is bad. 4.2.2 means the mailbox is over quota. 5.7.x codes concern policy or authentication.
That last family is where many teams go wrong. A 5.7.1 rejection is usually about you: a blocklisted IP, a failed authentication check, or a content filter. It says nothing about whether the address is valid. Suppressing every address that returns a 5xx code would throw away good subscribers whenever your own reputation dips.
Classifying bounces in code
The function below turns an enhanced status code into one of five outcomes. It separates address problems (hard, soft) from sender problems (block).
def classify_bounce(status: str) -> str:
"""Classify an enhanced SMTP status code such as '5.1.1'."""
parts = status.split(".")
if len(parts) != 3 or not all(p.isdigit() for p in parts):
return "unknown"
cls, subject, _detail = parts
if cls == "2":
return "delivered"
if cls == "5" and subject == "7":
return "block" # policy or reputation problem, not a bad address
if status == "5.2.2":
return "soft" # full mailbox, sometimes sent as a permanent code
if cls == "5":
return "hard"
if cls == "4":
return "soft"
return "unknown"
if __name__ == "__main__":
samples = ["5.1.1", "4.2.2", "5.2.2", "5.7.1", "2.0.0", "garbage"]
for code in samples:
print(f"{code:8} -> {classify_bounce(code)}")Running it prints hard, soft, soft, block, delivered, and unknown for the six samples, in that order. Anything classified unknown should go to a log for review. Do not suppress it automatically.
A rule for soft bounces
A single soft bounce is noise. A full mailbox may clear next week, and a server outage ends. Repeated soft bounces over several weeks suggest an abandoned mailbox. A common approach is to suppress after a set number of consecutive soft bounces inside a time window. This query finds candidates, using a bounce_events table alongside the engagement_events table from the earlier chapters:
SELECT b.subscriber_id,
COUNT(*) AS soft_bounces,
MAX(b.occurred_at) AS last_bounce_at
FROM bounce_events b
WHERE b.bounce_type = 'soft'
AND b.occurred_at > now() - interval '30 days'
GROUP BY b.subscriber_id
HAVING COUNT(*) >= 3;The thresholds of 3 bounces and 30 days are starting points. Tune them to your sending frequency. A weekly sender needs a longer window than a daily sender to see the same number of attempts.
Spam traps: the silent signal
A spam trap is an address that belongs to no real person, run by a mailbox provider, anti-abuse organization, or blocklist operator. Real subscribers never opt in to a trap, so any mail it receives suggests the sender collected addresses carelessly or does not clean its list. Trap hits can lead to blocklisting or reduced inbox placement. The operators of a trap rarely tell you which address caught you, which is why prevention matters.
There are three common types.
Pristine traps
A pristine trap is an address created for the purpose of catching senders. It never belonged to a real user and has never signed up for anything. The address is typically published where scrapers collect addresses, or it ends up on purchased lists. A pristine hit points at how you acquire addresses, not at inactivity. Sunsetting does not fix it. Strict opt-in does.
Recycled traps
A recycled trap was once a real mailbox. After the owner stopped using it, the provider kept the address alive and turned it into a trap. Mail sent to such an address is silently accepted. Providers do not publish how long an address must be dormant before this happens, so assume the clock is unknown. This is the type that connects directly to this tutorial: the longer an address sits unengaged, the more likely it is to be abandoned and possibly recycled. Your oldest inactive subscribers are the likeliest source.
Typo traps
A typo trap is a mistyped domain, such as gmial.com, that someone has registered to collect misdirected mail. These come from sign-up forms without validation. A single typo at sign-up can sit on your list for years without ever bouncing.
Abandoned addresses: the quiet middle
Between "bounces" and "traps" is the largest group: real mailboxes that accept mail and are never read. They do not bounce, so bounce handling cannot find them. They may be a person who changed jobs, a mailbox on a former employer's domain, or a secondary address used once for a discount code. Inbox providers see the same pattern for each: mail arrives, nobody reacts.
Abandonment has two costs:
- Reputation cost. Mailbox providers watch how recipients treat your mail. A large share of recipients who never react drags down your engagement picture.
- Trap exposure. Some abandoned addresses will later turn into recycled traps. You will not be told when that happens.
This is the reason the next chapters define engagement and set a window. Bounce data cannot find abandoned addresses, so engagement data has to.
How the signals fit together
Each signal answers a different question, and each calls for a different action.
| Signal | Question it answers | Visible to you? | Action |
|---|---|---|---|
| Hard bounce | Does this address exist? | Yes | Suppress now |
| Repeated soft bounce | Is this mailbox likely abandoned? | Yes | Suppress after threshold |
| Block bounce (5.7.x) | Is my sender identity the problem? | Yes | Fix sender, keep address |
| No engagement | Is anyone reading? | Yes, with caveats | Re-engage, then sunset |
| Trap hit | Did my acquisition or hygiene fail? | Mostly no | Prevent upstream |
Bounce handling should run continuously and fast. Engagement-based sunsetting runs on a slower schedule, because it needs a full inactivity window of data.
Common errors
- Suppressing on any 5xx code. As noted above, 5.7.x codes describe your sender, not the address.
- Ignoring soft bounces forever. A mailbox that soft-bounces every send for months is effectively dead, and a retry loop on it is wasted volume.
- Treating "no bounce" as "valid." A trap accepts mail without complaint. A clean bounce report does not prove a clean list.
- Re-adding suppressed addresses from imports. If an old export is loaded back in, hard-bounced addresses return. Keep suppression as a separate list that imports are checked against.
- Skipping validation at sign-up. Catching
gmial.comat the form is cheaper than finding it later. - Relying on a purchased or rented list. These lists are a major source of pristine traps. No amount of sunsetting offsets this.
Prevention checklist
- Use confirmed (double) opt-in, or at least validate addresses at sign-up, including common domain typos.
- Suppress hard bounces on the first occurrence.
- Suppress repeated soft bounces after a threshold you have tested.
- Never mail purchased, rented, or scraped lists.
- Keep a persistent suppression list and check every import against it.
- Sunset long-unengaged addresses, which the next chapters define in detail.
Exercise
A receiving server returns status 5.7.1 for 400 of your subscribers on the same day. Your bounce handler suppresses every 5xx code. What should you do differently, and why?
Show answer
Treat 5.7.x as a block bounce, not an address bounce. Do not suppress the 400 subscribers. A 5.7.1 rejection normally reflects your sending IP, domain authentication, or content, so look at blocklists, SPF, DKIM, DMARC, and recent content changes. Suppressing them would remove valid subscribers and leave the real problem in place.
Exercise
A subscriber has not clicked in 14 months, has never bounced, and mail to them is accepted every time. Why can bounce handling not find this address, and what two risks does it carry?
Show answer
The mailbox accepts mail, so no bounce is generated and bounce data shows nothing wrong. The address may be abandoned. It carries a reputation risk, because a large share of unreacting recipients weakens your engagement signals, and a trap risk, because abandoned addresses can later be recycled into spam traps without notice. An engagement-based inactivity window is what finds it.