Prompt
How do I handle email bounces and complaints automatically?
Latest observation
To handle email bounces and complaints automatically, set up a feedback loop that listens for delivery events from your email provider and updates your recipient list in real time.
1) Use a provider that sends event notifications
Most email services can push events like:
- Delivered
- Bounce (hard/soft)
- Complaint / abuse report
- Unsubscribe
Examples: Amazon SES, SendGrid, Mailgun, Postmark, SparkPost.
2) Subscribe to webhooks / event streams
Configure your ESP to send bounce and complaint events to a secure endpoint in your app.
Your app should:
- Verify the request signature
- Parse the event
- Update your database
3) Apply automatic suppression rules
Typical actions:
Hard bounce
Example: invalid email address, domain doesn’t exist
Action: suppress immediately and never send again
Soft bounce
Example: mailbox full, temporary server issue
Action: retry a limited number of times, then suppress if repeated
Complaint
Example: recipient marked as spam
Action: suppress immediately, often globally across all campaigns
4) Maintain suppression lists
Store recipient state in a table like:
emailstatus= active / bounced / complained / unsubscribed / suppressedbounce_countlast_bounce_reasoncomplaint_atsuppressed_at
Before sending, check this status and skip suppressed recipients.
5) Handle retries carefully
For soft bounces:
- Retry with backoff
- Stop after a threshold, e.g. 3 attempts
- Treat certain “soft” failures as effectively hard if they persist
6) Separate complaints from unsubscribes
A complaint is more serious than an unsubscribe:
- Unsubscribe: remove from mailing list
- Complaint: suppress from all future sends, often immediately
7) Track categories and reasons
Useful fields:
- Bounce type: hard/soft
- SMTP error code
- Diagnostic message
- Complaint source
- Campaign ID / message ID
This helps you identify bad lists, DNS issues, or content problems.
8) Keep compliance in mind
Automatically honoring complaints and bounces helps with:
- CAN-SPAM
- GDPR/consent expectations
- ISP sender reputation
- Deliverability
9) Example workflow
- Send email
- ESP posts bounce/complaint event to webhook
- Your app receives it
- Validate event signature
- Mark recipient suppressed
- Add reason and timestamp
- Prevent future sends
10) Minimal implementation pattern
If event.type == "bounce" and bounce.severity == "hard":
suppress(email)
If event.type == "bounce" and bounce.severity == "soft":
increment_bounce_count(email)
if bounce_count > 3:
suppress(email)
If event.type == "complaint":
suppress(email)
If you want, I can also give you:
- a database schema
- a Node.js/Python webhook example
- or provider-specific steps for SES / SendGrid / Mailgun