WSS
Web Specification Studio Home
On this page
LifecycleRequiredUpdated

Automated Bounce Handling & Delivery Status Notifications (DSN)

Classify and process hard and soft delivery failures using RFC 3463 enhanced status codes, Variable Envelope Return Path (VERP), and instant suppression automation.

What it is

Bounce handling is the operational mechanism by which an email sender receives, parses, and acts upon Delivery Status Notifications (DSN) returned when an email cannot be delivered to the destination mailbox.

When delivery fails, the receiving MTA generates an asynchronous DSN (RFC 3464) and dispatches it back to the envelope sender address specified in the SMTP MAIL FROM parameter:

Content-Type: multipart/report; report-type=delivery-status; boundary="boundary-99"

--boundary-99
Content-Type: message/delivery-status

Reporting-MTA: dns; mx.destination.com
Final-Recipient: rfc822; [email protected]
Action: failed
Status: 5.1.1
Diagnostic-Code: smtp; 550-5.1.1 The email account that you tried to reach does not exist.

Why it matters

  • Reputation Protection: Mailbox providers monitor the ratio of hard bounces to successful deliveries. A hard bounce rate exceeding 2.0% triggers immediate IP throttling, temporary greylisting, or complete routing to the spam folder.
  • Differentiates Temporary Glitches from Dead Mailboxes: RFC 3463 enhanced status codes categorize errors into permanent failures (5.X.X) versus transient recoverable conditions (4.X.X), ensuring you do not prematurely suppress active users during temporary mailbox outages.
  • Resource Conservation: Removing invalid addresses immediately prevents wasted SMTP connection overhead and cloud API consumption on subsequent campaigns.

How to implement

1. Understand Enhanced Status Code Classes (RFC 3463):

Code PatternCategoryDefinitionAutomated Action
5.1.1Hard BounceBad destination mailbox address (user does not exist)Immediate permanent suppression
5.1.2Hard BounceBad destination system address (domain does not exist / invalid MX)Immediate permanent suppression
5.7.1Policy FailureDelivery not authorized, message refused by security policyFlag for security / DMARC review
4.2.2Soft BounceMailbox full / quota exceededRetry with exponential backoff up to 72h
4.4.1Soft BounceConnection timed out during SMTP handshakeRetry later with backoff
4.7.0Soft BounceTemporary server throttling / greylistingRetry with delayed schedule

2. Implement Variable Envelope Return Path (VERP). When broadcasting large email volumes, bounce emails often lack the original recipient headers due to forwarding. Use VERP to encode the recipient’s identity directly into the envelope sender (MAIL FROM):

Standard MAIL FROM: [email protected]
VERP MAIL FROM:     [email protected]

When a bounce returns to [email protected], your bounce daemon extracts [email protected] directly from the local-part without needing to parse complex email bodies.

3. Configure Automated Webhook & Queue Processing: Process bounce events in real time:

  • For Hard Bounces (5.X.X): Immediately write the address to a centralized suppression table and cancel all queued messages to that address.
  • For Soft Bounces (4.X.X): Increment a failure counter. If an address records 3 to 5 consecutive soft bounces across distinct campaigns over a 14-day window without an intervening successful delivery, automatically escalate to hard suppression.

Common mistakes

  • Using the Visible From: as the Envelope Return-Path: Sending bounces to the personal or marketing From: address ([email protected] or [email protected]) floods human inboxes with bounce notifications instead of routing to an automated bounce parser.
  • Generating Auto-Replies to Bounces (Backscatter): Never send an automated notification acknowledging receipt of a bounce message. Doing so generates “backscatter” spam to innocent third parties and leads to immediate IP blocklisting.
  • Treating All 5XX Codes as Dead Mailboxes: Some providers return 5.7.1 (anti-spam / DMARC rejection) or 5.3.0 (rate limit). Suppressing users who experienced a temporary policy rejection permanently loses legitimate subscribers.
  • Ignoring Asynchronous Delayed Bounces: Assuming that a 250 OK at SMTP transmission time guarantees delivery. Many receiving MTAs accept the message into their local spool and subsequently generate a bounce message minutes or hours later.

Verification

1. Test VERP bounce extraction: Send a test message with a VERP envelope to a nonexistent mailbox ([email protected]) and verify that your bounce handler extracts the target address and updates the suppression database.

2. Query suppression logs in database:

SELECT status_code, diagnostic_message, created_at 
FROM email_bounces 
WHERE email = '[email protected]';

Related topics

Sources & further reading