How to Extract SMTP Error Codes from Amazon SES Complaint Notifications
Learn how to parse Amazon SES complaint notifications to extract SMTP error codes and improve email deliverability.
Why AWS SES Complaint Notifications Matter for Deliverability
You sent an email. It bounced. Not a soft bounce—you got a complaint notification from Amazon SES. That’s not just a bounce. It’s a red flag from a real person who marked your message as spam.
Every complaint notification contains raw SMTP error codes—like 550 or 554—embedded in the delivery failure details. These codes reveal exactly why the email was rejected, down to the protocol level. Ignoring them means sending to inboxes that have already rejected you, which harms sender reputation and increases the risk of being blocked.
Automated tools might tell you an address is “valid,” but only by extracting SMTP error codes from SES complaints can you know if that inbox is hostile, quarantined, or actively hostile. This isn’t guesswork. It’s a direct signal from the receiving server.
Key takeaways
- Amazon SES complaint notifications include raw SMTP error codes (such as 550, 554) that indicate the exact reason an email was rejected at the protocol level.
- Failing to extract these codes from complaints leads to continued delivery to invalid or hostile inboxes, increasing spam trap hits and damaging sender reputation.
- By analyzing SMTP error codes from SES complaints, you can proactively identify and remove problematic addresses, improving overall deliverability and inbox placement rates.
How Amazon SES Sends Complaint Notifications
Amazon SES sends complaint notifications through Amazon SNS, not directly to your inbox. The notification includes a raw MIME part that resembles a delivery failure report, containing the original recipient, timestamp, and the SMTP response line—starting with a 3-digit code like 550 or 554—that indicates why a complaint was triggered.
SNS: The Bridge Between SES and Your System
When a recipient marks an email as spam, SES doesn’t send a message to your inbox. Instead, it publishes a notification to an SNS topic you’ve subscribed. You must set up an SNS subscription (e.g., to a Lambda function, HTTP endpoint, or SQS queue) to receive and process these messages programmatically.
This approach gives you full control over how complaints are handled—automating suppression, logging, or even triggering a feedback loop with your email service. It’s a reliable, scalable pattern used across AWS infrastructure and documented in AWS’s own service docs.
Decoding the Raw MIME Part
The complaint notification payload includes the original email as a raw MIME message. This is not a clean JSON object—it’s a full email message encoded as a MIME part, including headers and body. The key info you need—especially the SMTP error code—is often in the delivery status notification (DSN) header or the first few lines of the body.
Look for the final SMTP response line sent by the recipient’s server. It starts with a three-digit code like 550 (user unknown) or 554 (rejected). These codes come from the standard SMTP RFC 5321 and are consistent across most mail systems.
While you can parse this manually, the process is fragile. Misinterpreted MIME structures, encoding glitches, or missing DSNs can make extraction unreliable. For teams focused on deliverability, this is where tools like bulk email list cleaning help—by validating addresses before sending, you reduce the chance of complaints in the first place.
Where to Find the SMTP Error Code in a SES Complaint
When Amazon SES sends a complaint notification, the SMTP error code appears in the MIME payload, typically within the X-SES-Original-Message header or in the error message body. Look for lines starting with standard SMTP response codes like 550, 554, 552, 553, 450, or 451. For example, a message saying 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown means the error code is 550, indicating a permanent failure due to an invalid recipient.
Locating the Code in the Payload
Amazon SES includes the original message in the complaint notification’s MIME body. The X-SES-Original-Message header contains the raw SMTP transaction log, where the error codes are returned by the receiving server. These codes follow the standard RFC 5321 and RFC 5322 conventions for SMTP error responses.
Let’s say your message gets rejected with 554 5.7.1 Service unavailable; client was blocked. The code 554 means the server permanently rejected the message—often due to a blacklisted IP or domain. You’ll find this line directly in the message body, usually after a newline following the 5xx status line.
Common Error Codes and Their Meanings
Validating the meaning of these codes helps you distinguish hard bounces (like 550, 552) from transient issues (like 450, 451). Codes starting with 5xx indicate a permanent failure, while 4xx usually mean temporary issues. For instance:
550– Recipient address rejected (e.g., mailbox doesn't exist).552– Message size exceeds limit.553– Invalid sender address.554– General rejection; often due to spam content or blacklisting.450– Temporary failure; retry later.451– Local error; the server is busy but will process the message later.
Understanding these codes lets you clean your list before future sends. If you're seeing consistent 550s from a domain, it's safe to remove those addresses. This is how you improve deliverability, reduce bounce rates, and maintain sender reputation. Use tools that validate email addresses in real time to catch invalid addresses before sending at all—preventing complaints and failed deliveries.
For teams sending at scale, automated validation helps. Clean your list in bulk with checks that identify invalid, disposable, or risky emails—so you’re not sending to addresses doomed to fail or trigger complaints. This proactive step cuts down on rejected messages and helps you stay in good standing with inbox providers. For developers, integrate real-time verification to test each address as you collect it, reducing the risk before a message ever leaves your system.
How to Extract SMTP Error Codes from SES Complaints: A Step-by-Step Process
You can extract SMTP error codes from Amazon SES complaint notifications by setting up an SNS topic to receive complaints, subscribing a backend service to it, parsing the raw MIME content of the complaint email, and searching for lines starting with 3-digit SMTP codes. These codes—like 550 or 551—are the actual rejection reasons from the recipient’s server. They provide clearer insight than just seeing "complaint" or "bounced" in logs.
1. Set up an SNS topic for complaint notifications
Go to the Amazon SES console and create an SNS topic. Associate it with your verified email identity. This ensures you receive notifications when recipients mark your email as spam.
Amazon SES sends complaint notifications only for identities that are verified and used in production. The topic receives JSON data for each complaint event. You’ll need to set a policy on the topic to allow SES to publish events.
2. Subscribe your application or Lambda function
Subscribe your backend—whether it's a Lambda function, a web service, or a third-party tool—to the SNS topic. This can be done via Amazon SNS console, AWS CLI, or infrastructure-as-code tools like CloudFormation.
Setting up a Lambda function with an SNS trigger is common. It allows you to auto-process the complaint, extract error details, and update your suppression list in real time.
- Fetch the SNS message delivered to your endpoint. The message is a JSON object containing a
Messagefield. - Extract the
Messagefield, which holds the raw complaint email in MIME format. - Use a library like Python’s
email.parseror Node.js’smailparserto decode and parse the MIME content. - Locate the body of the complaint email (often in plain text or HTML). Search through the text for lines starting with a 3-digit number followed by a space—these are standard SMTP response codes.
- Example:
550 5.1.1 The email account that you tried to reach does not exist. Capture both the code (550) and the full error message. - Store the code and context in a database or analytics dashboard. Use it to identify patterns, such as recurring invalid domains or role account complaints.
These codes align with official SMTP standards defined in RFC 5321 and RFC 5322, which govern email transmission and failure codes. Recognizing the pattern helps distinguish between temporary issues (like 4xx codes) and permanent failures (5xx codes).
Use this data to improve list hygiene—flag recurring invalid addresses, reduce complaint rates, and support sender reputation. For broader list health, consider running bulk verification on your entire list. See how it works: clean your list with real-time validation.
Common SMTP Error Codes in SES Complaints and What They Mean
You can extract SMTP error codes from Amazon SES complaint notifications by parsing the MessageID and FeedbackType fields in the SNS message payload, then decoding the DiagnosticCode field which contains the SMTP response. These codes directly reflect recipient server decisions, like address validity, mailbox status, or policy-based rejections. You’ll see codes like 550, 554, or 5.1.1 as part of the standard SMTP transaction response.
Key SMTP Error Codes and Their Meaning
Here’s how to interpret the most common SMTP error codes in Amazon SES complaint notifications. These codes are standardized by RFC 5321 and RFC 5322, so they’re consistent across providers.
| SMTP Code | Meaning | Typical Cause | Recommended Action |
|---|---|---|---|
| 550 5.1.1 | Recipient unknown | Invalid email address, non-existent mailbox, or domain doesn’t exist. | Remove the address from your list. Use real-time validation to catch these early. Validate your list before send. |
| 550 5.1.2 | Mailbox blocked or unavailable | Recipient server blocked the sender, or the mailbox has a restriction (e.g., internal policy). | Check if the sender is blacklisted. Investigate the domain reputation. Use inbox placement testing to detect early delivery issues. |
| 550 5.2.0 | Mailbox full | Recipient inbox has reached storage capacity. | Try resending after a delay. Frequent failures like this may signal inactive users—consider re-engagement or suppression. |
| 550 5.4.0 | Message rejected by policy | Spam filter, content filter, or message authentication failure (e.g., missing DMARC). | Review message content and authentication setup (SPF, DKIM, DMARC). Use tools like MxToolbox to test your sender reputation. |
| 554 5.7.1 | Sender blocked | Sender IP or domain is on a blocklist, or reputation is poor. | Check your IP and domain against public blocklists like Spamhaus. Use a tool like Spamhaus to verify your standing. |
Using SES Notifications to Automate Cleanup
Amazon SES sends complaint notifications via SNS when bounces or delivery issues occur. You can use a Lambda function or similar automation to parse the DiagnosticCode and act on it—like automatically suppressing invalid addresses or alerting your team to a spike in 5.7.1 errors. This reduces manual cleanup and improves long-term deliverability. You’re not just reacting to bounces—you’re using the system’s built-in feedback to refine your list management.
How SMTP Error Codes Link to List Hygiene and Deliverability
You can use SMTP error codes from Amazon SES complaint notifications—like 550 (User unknown) or 554 (Message rejected)—to identify problematic email addresses, domains, or patterns in your list. Repeated 550 or 554 codes from the same domain often signal a poisoned or outdated list, while consistent failures on certain address formats can reveal disposable domains or role accounts. Aggregating these errors helps you prune bad data before large sends, improving deliverability and sender reputation.
Spotting Broken or Poisoned Lists
When Amazon SES returns a consistent 550 or 554 error for multiple addresses under the same domain, it’s a strong signal that the domain or list is compromised. These errors mean the receiving server explicitly rejected the email. If it happens across dozens of addresses, the domain may be either inactive, actively blocking your brand, or hosting a list that was scraped from elsewhere. That’s not sender reputation you want—avoiding it means you stop sending to entire domains before they hurt your deliverability.
Filtering Out High-Risk Addresses and Domains
SMTP codes help you spot red flags beyond just bounces. A 554 error with "unverified recipient" or "not in our whitelist" often appears with disposable domains—like tempmail or throwaway services. Similarly, recurring 550s on addresses like info@, support@, or admin@ suggest role accounts that are rarely engaged and often filtered. These aren’t real people, and they don’t deliver ROI. Using Amazon SES logs to track such codes helps you isolate and remove these patterns before sending at scale.
Aggregating these error types lets you build a ruleset: for example, block any email ending in @tempmail.com or any send to a domain with more than 10 failed attempts in a week. This proactive filtering is an industry-standard practice that reduces bounce rates, avoids blacklists, and keeps your sender reputation clear. The goal isn’t just to reduce errors—it’s to stop sending to addresses that were never meant to be delivered to in the first place.
Tools like bulk email list cleaning can automate this, checking for invalid syntax, role accounts, and disposable domains before you send. You’re not just reacting to bounces—you’re preventing them.
How Email List Validation Improves Your SES Complaint Analysis
Running bulk list validation before sending to Amazon SES lets you catch invalid, role-based, or disposable email addresses in advance—many of which trigger SMTP error codes like 550 or 554. By identifying these before sending, you reduce both bounce rates and complaints, leading to cleaner SES logs and a stronger sender reputation. You’ll spend less time debugging delivery issues and more time focusing on real engagement signals.
Prevent SES Bounces and Complaints with Pre-Send Validation
- Use bulk email list cleaning to scan your entire list before a campaign, filtering out addresses that historically cause 5xx SMTP errors like 550 (user unknown) or 554 (rejected by policy).
- Integrate the real-time email verification API into your signup or import workflow to flag problematic addresses instantly, including ones that trigger hard bounces or are linked to high spam scores.
- Remove role-based emails (like sales@, info@, admin@) early—they're often ignored or flagged as spam, increasing your risk of complaint notifications and reducing sender reputation.
- Filter out disposable or temporary email domains (like Mailinator, TempMail, MailDrop) that rarely result in engagement and are commonly used in spam campaigns.
Improve SES Deliverability by Removing High-Risk Signals
- Identify addresses tied to known bounce patterns or prior complaint events. These often appear in your Amazon SES complaint notifications and can signal poor list hygiene.
- Validate lists using tools that check for syntax, domain existence, and SMTP-level response codes—this helps you catch misconfigured or expired addresses before they hit SES.
- Review your past complaint logs and compare them against validated email data. You’ll notice that addresses rejected with 550 or 554 codes are frequently flagged during pre-send validation.
- Use a tool with inbox placement testing to see how your message lands in real inboxes—addresses that consistently fail deliverability tests may not be worth sending to at all.
According to RFC 5321, SMTP servers reject messages with hard failures using 5xx codes. These are not just technical glitches—they’re signals of list quality. By cleaning your list proactively, you avoid cluttering your complaint logs with preventable errors. Let’s stop reacting to SES errors and start preventing them.
Using the Email List Validation API to Prevent Complaints
You can extract SMTP error codes from Amazon SES complaint notifications by integrating Email List Validation’s real-time API into your email workflow. The API checks every address before sending, flagging invalid or risky emails—so you never send to addresses that trigger complaints or bounce. This proactive step reduces inbox placement issues and strengthens sender reputation.
Verify at the Point of Entry
Let’s say someone signs up via your form or uploads a list. Instead of trusting the input, plug it into the Email List Validation API right away. You get immediate feedback: valid, invalid, catch-all, or risky. For every invalid or risky result, block the address from your send list.
The difference is measurable. Addresses that are dead, typo-ridden, or from disposable domains often lead to complaints—especially when you send to them repeatedly. Email List Validation identifies these with 98.9% accuracy, which means fewer bounces, fewer spam traps, and fewer flagged messages. That’s not just better hygiene—it’s critical for maintaining deliverability.
Because Amazon SES complaints are a direct signal to mailbox providers that you’re sending unwanted mail, preventing them at the source is essential. A single complaint can hurt your sender reputation for days. By filtering out the weakest addresses before they ever join your campaign, you reduce exposure. This is not a luxury—it’s a baseline requirement for reliable sending.
For example, if an email is from a disposable domain, it’s not just invalid. It’s a known proxy for spam behavior. Similarly, role accounts like admin@ or marketing@ often have low engagement and are prone to complaints when used in mass campaigns. You don’t want these in your list.
The API handles this in real time, whether you're validating a single address or an entire list. You can integrate it with tools like Mailchimp, Klaviyo, HubSpot, or SendGrid—ensuring that even imported contacts are cleaned before they hit the inbox. You can learn more about how this works at the real-time verification API page.
Remember: you can’t fix a complaint after it happens. You can only prevent it. That’s why verification belongs in the workflow, not the post-mortem. Use the API not as an afterthought, but as your first line of defense against deliverability risk.
Avoiding Common Mistakes in Parsing SES Complaints
You don’t just want to see complaint notifications from Amazon SES — you need to parse the underlying SMTP error codes correctly. Mistakes here lead to wasted effort: treating temporary issues like permanent ones, missing early warnings in complaint volume trends, or failing to automate checks. Let’s get the mechanics right.
Parse SMTP Error Codes with Precision
- Don’t assume every complaint is a hard bounce. A 4xx code (like 451 or 452) means temporary delivery failure — the email might still be deliverable later. A 5xx code (e.g., 550 or 551) means the recipient server permanently rejected the message. Only 5xx codes signal final rejection.
- Use Amazon SES’s built-in complaint event structure: check the
complaint.feedbackTypeand extract thecomplaint.bounceTypeandcomplaint.bouncedRecipientsfields. These contain the raw SMTP code in thecomplaint.bouncedRecipients[].statusfield. - Don’t rely on reading raw logs manually. Human reading is slow and error-prone. Automate the parsing of these error codes with a script or service that flags 5xx codes immediately and tracks them across time.
- Check RFC 3463 for the official SMTP status code definitions. That’s the source of truth — don't guess at what a 550 means.
Look Beyond the Single Complaint
- Don’t ignore trends. A sudden spike in 550 errors from a single domain (like
@example.com) often points to stale or invalid emails — your list is decaying. Monitoring volume over time reveals this faster than reacting to one complaint. - Use tools that track error patterns across large volumes. The same email address hitting multiple 5xx errors across different campaigns signals an issue with list hygiene.
- Integrate with a service that validates email addresses before sending. Catching invalid addresses early reduces complaint volume entirely. Clean your list in bulk before each campaign to reduce bounce and complaint risks.
- Combine this with inbox placement testing to confirm your emails are not just being rejected but also landing in spam folders. That’s a different problem — but still one your list hygiene can help prevent.
Automated, code-aware parsing turns raw complaints into actionable insight. It’s not about seeing more errors — it’s about seeing the right ones, in time.
How to Reduce Complaints by Proactively Cleaning Your List
Monitor your Amazon SES complaint rate monthly, and use Email List Validation to remove invalid, catch-all, or disposable emails before sending. This reduces bounces and complaints—common causes of sender reputation damage. Clean lists improve inbox placement and help avoid throttling or suspension.
Identify Problematic Addresses Before They Trigger Complaints
- Use bulk email list cleaning to scan your entire list for invalid, catch-all, or disposable email addresses before sending via Amazon SES.
- Remove any address flagged as invalid or risky—these are high-probability sources of hard bounces or spam complaints.
- Disposable domains (like tempmail.org) often resolve but aren't meaningful. These are frequently used for form spam and signal low engagement; filtering them improves list quality.
- Catch-all addresses accept all incoming mail, which inflates delivery counts without real recipients. They contribute to poor engagement metrics and can trigger spam filters.
Turn Data into Ongoing Hygiene Practices
- Set up monthly checks of Amazon SES complaint notifications and compare them against your list size. A complaint rate above 0.1% is a red flag.
- Use the real-time email verification API to validate new signups as they arrive, catching invalid addresses at the point of entry.
- Apply SPF, DKIM, and DMARC consistently to maintain sender reputation. Misconfiguration increases the chance of emails being blocked or marked as spam.
- Keep a record of bounce and complaint trends. Over time, this data reveals patterns—like specific domains or segments that cause issues—so you can adjust your sourcing or segmentation.
According to U.S. Digital Service guidelines, maintaining clean sender lists is an industry-standard practice for email deliverability. When you validate every address upfront, you reduce the risk of violating platform policies—especially on AWS, where consistent performance affects access.
Conclusion: Turn Complaints Into Actionable Data
Amazon SES complaint notifications are not just alerts—they are raw data points that reveal when emails are being marked as spam. Extracting SMTP error codes from these alerts lets you distinguish between transient issues and persistent problems, so you can act before reputation scores decline.
By matching complaint data with real-time verification, you can identify and remove invalid or risky addresses before they trigger bounces or spam reports. This proactive approach reduces long-term deliverability risks and helps maintain sender reputation across mailbox providers.
Sources
- GetResponse benchmarks put the average unsubscribe rate at 0.15% and the average spam complaint rate below 0.01% of sends. — GetResponse Email Marketing Benchmarks (2024)
- HubSpot's list-health benchmarks show an average bounce rate of 2.48% and an average unsubscribe rate of 0.22% across industries. — HubSpot (2025)
Keep reading
- Bounce management: hard bounces, soft bounces and bounce rate (complete guide)
- Email Validation API to Prevent 550 5.1.9 Address Policy Failures
- How to Fix 550 5.1.2 Invalid User Error from Gmail SMTP
- Email Verification Tools That Predict 554 5.7.1 Spam Failure Before Send
- Why My Bulk Emails Are Bouncing With 550 5.1.3 Mailbox Full
Ready to put this into practice? Email List Validation verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
What is an SMTP error code in Amazon SES complaint notifications?
An SMTP error code (e.g. 550, 554) is a 3-digit response sent by a recipient server indicating why an email was rejected. These codes are embedded in the complaint notification's MIME payload.
Can I automate the extraction of SMTP codes from SES complaint notifications?
Yes — use AWS SNS with a Lambda function or backend service to parse the complaint JSON, extract the raw message, and search for lines starting with 3-digit codes.
Why do I keep getting 550 errors in SES complaints?
A 550 error means a recipient address is unknown or rejected by the mail server. This often indicates invalid or non-existent email addresses on your list.
How does Email List Validation help with SES complaints?
It verifies email addresses in advance, flagging invalid, risky, or disposable addresses that would otherwise trigger 550 or 554 errors and complaints.
Do all SES complaints result in SMTP error codes?
Yes — every complaint includes the original SMTP response line from the recipient server, typically with a 5xx or 4xx code indicating the failure reason.
What's the difference between a 550 and a 554 error in SES?
550 means the recipient address is invalid or unknown. 554 means the message was rejected due to policy, like spam filtering or sender blocklist.
How can I track SMTP error patterns across my email list?
Aggregating errors from complaint notifications by domain or address pattern helps identify trends, such as recurring role accounts or disposable domains.
Should I trust complaint notifications to clean my list?
No — complaints are reactive. Use them to spot problems, but act proactively with tools like Email List Validation to verify and clean before sending.
What happens if I ignore 550 errors from SES?
Repeated 550 errors harm sender reputation, increase the risk of being blacklisted, and reduce inbox placement over time.
Can I use Email List Validation with AWS SNS and SES?
Yes — integrate the Email List Validation API into your SNS processing pipeline to verify contacts before sending, reducing the chance of complaints.