---
title: "Stop on permanent failures and retry · Agent Wranglers"
url: https://agentwranglers.se/playbook/email/unsubscribe-and-bounces/handle-bounces
updated: 2026-10-20
licence: "All rights reserved"
---

# Stop on permanent failures and retry temporary ones

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Unsubscribe and bounces](https://agentwranglers.se/playbook/email/unsubscribe-and-bounces)
- Rule: Read every bounce and SMTP reply. Suppress an address after a permanent failure for a bad mailbox, and retry only temporary failures.
- How: SMTP reply codes starting with 5 are permanent, and those starting with 4 are temporary (RFC 5321). Enhanced status codes add detail (RFC 3463). `5.1.x` means the address is bad, so suppress it. `5.7.x` means the receiver refused you for policy or authentication. Fix your sending instead of dropping the address. Parse delivery status notifications (RFC 3464) and match them to the message, for example with a unique return path per message (VERP).
- Check: Send to an address that does not exist. The bounce is recorded against the message, and the address is suppressed. A test bounce with `5.7.1` raises an alert and leaves the address active.

Example:

```text
550 5.1.1 <nobody@example.com>: Recipient address rejected: User unknown
550 5.7.515 Access denied, sending domain does not meet the required authentication level
451 4.7.1 Try again later
```

```js
function bounceAction(enhancedCode) {
  if (enhancedCode.startsWith('4.')) return 'retry';
  if (enhancedCode.startsWith('5.1.')) return 'suppress-address';
  return 'alert-sender-team';
}
```

```python
def bounce_action(enhanced_code: str) -> str:
    if enhanced_code.startswith("4."):
        return "retry"
    if enhanced_code.startswith("5.1."):
        return "suppress-address"
    return "alert-sender-team"
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers email playbook: https://agentwranglers.se/playbook/email/unsubscribe-and-bounces/handle-bounces`.

- Previous: [Keep transactional mail free of marketing](https://agentwranglers.se/playbook/email/unsubscribe-and-bounces/transactional-only)
- Next: [Retry with backoff and give up in time](https://agentwranglers.se/playbook/email/unsubscribe-and-bounces/retry-and-expire)
- [Unsubscribe and bounces](https://agentwranglers.se/playbook/email/unsubscribe-and-bounces)
