How to Use Mailgun’s Webhook to Monitor Deliverability and Verify Emails
Monitor inbox placement and verify emails in real time using Mailgun’s webhook. Clean your list, reduce bounces, and boost deliverability with MailTester’s
Why you need email verification and deliverability monitoring
You send an email. It says “delivered” — but is it actually in the inbox? Or is it stuck in spam, auto-deleted, or silently bouncing?
Too many teams assume a “delivered” status means success. But without real-time feedback on where the email lands, you’re guessing. And guessing wastes time, damages sender reputation, and kills campaign performance.
Mailgun’s webhook sends delivery event data — including bounces, spam reports, opens, and actual inbox placement — as it happens. When paired with MailTester, that data becomes a verifier: not just whether the email was sent, but whether it was seen.
Key takeaways
- Mailgun’s webhook captures delivery events like bounces and spam reports in real time, enabling immediate action.
- MailTester uses webhook data to verify that emails not only reach the server but land in the inbox, not spam.
- Combining webhook data with email verification detects invalid addresses and delivery failures before they harm sender reputation.
How Mailgun’s webhook works with email delivery events
Mailgun sends real-time HTTP callbacks for every email event—delivered, bounced, opened, clicked, or marked as spam—directly to a URL you configure. These callbacks let you track delivery status as it happens, not after the fact. You can use this data to update your records, trigger alerts, or feed it into tools like MailTester for deeper analysis.
Real-time event tracking with custom endpoints
Each time an email sent via Mailgun triggers an event, Mailgun POSTs structured data to your specified endpoint. This includes the email address, event type, timestamp, and metadata like user agent or IP address. You don’t need to poll an API; the event comes to you instantly.
Think of it like a delivery tracking feed: instead of checking the status later, you get an update the moment the email lands in a mailbox or fails to deliver. This is how high-volume senders maintain inbox placement accuracy and reduce bounces.
Mailgun’s event system follows RFC 5322 and RFC 6784 conventions for email transmission integrity, ensuring event data is consistent across providers. The full list of events and their payloads is documented officially at Mailgun’s official docs.
Integrating Mailgun webhooks with MailTester for verification and monitoring
To turn these events into actionable insights, route them to MailTester’s API. Every webhook event containing an email address can be sent to MailTester’s verification API for real-time analysis.
When a "delivered" event arrives, you can verify the address isn’t a catch-all or a disposable domain. When a bounce or spam complaint comes in, you know the address is invalid—and can remove it from your list before sending again.
Let’s say you’re tracking opens on your newsletters. You can use this webhook data to test whether an open actually came from a real user or a bot. Use MailTester’s inbox placement tool to simulate real inboxes and catch issues before they impact deliverability.
This workflow turns raw events into a live feedback loop. You no longer react to delivery issues—you prevent them. For teams managing large lists, this setup reduces bounce rates, improves sender reputation, and keeps your email list clean at scale.
Integrating Mailgun’s webhook with MailTester for verification
You can use Mailgun’s webhook to send delivery events to MailTester’s API, where they’re matched against real-time email verification results. When a ‘delivered’ event from Mailgun pairs with a ‘valid’ status from MailTester, you’ve confirmed inbox placement. This integration turns raw delivery data into actionable insight.
Set up the webhook and API connection
- Go to your Mailgun control panel and navigate to the Webhooks section. Enable the
deliveredevent type and enter MailTester’s API endpoint: https://mailtester.com/api/email-verify. This ensures every successful delivery is forwarded to MailTester for validation. - Generate an API key in your MailTester account and include it in the request headers as
X-API-Key. This authenticates the incoming event and keeps your data secure. Mailgun only sends delivery events to verified endpoints. - Test the setup by sending a test email through Mailgun. Check MailTester’s logs to confirm the event arrived. If the event shows up, the integration is active and processing data.
Validate and interpret the results
MailTester receives the event and cross-references the email address with its real-time verification engine. It checks the address against known patterns of invalid, disposable, or catch-all domains — using data from services like Spamhaus and MXToolbox for context.
A delivered event from Mailgun paired with a valid result from MailTester confirms the email was delivered to a real inbox. If the verification result is invalid or catch-all, the delivery event is likely a false positive — the email may be bouncing silently or routing to a non-existent mailbox.
For high-volume senders, this process reduces blind spots. Instead of trusting logs alone, you know exactly which deliveries reached active recipients. You can use this data to refine your list hygiene and improve sender reputation.
MailTester’s inbox placement tester lets you simulate how your message lands in real inboxes. Combine that with real delivery data to build a full picture of deliverability. No more guessing — only verified results.
To expand this system, you can integrate with tools like Mailchimp, Klaviyo, or SendGrid through MailTester’s integrations page. The same verification logic applies across platforms.
Deliverability isn’t just about hitting the inbox — it’s about landing in a real inbox managed by a real person.
What happens when Mailgun’s webhook detects a bounce
When Mailgun’s webhook receives a bounce event—whether hard or soft—it sends the data to your system instantly. You can then use that signal to trigger automated actions, like flagging the email address as invalid or risky in your CRM or email service. Tools like MailTester parse the bounce type and response code, then automatically mark the address accordingly, helping you remove problematic emails before they hurt your sender reputation.
Bounce types: hard vs. soft, and why it matters
Hard bounces—like "user unknown" or "domain does not exist"—mean the address is permanently invalid. Soft bounces, such as "mailbox full" or "message too large," indicate temporary issues. Mailgun’s webhook delivers both, but only hard bounces should prompt immediate removal.
Let’s say your system receives a hard bounce from Mailgun. The webhook payload includes the exact error code and the email address. You can now feed that data into an email verification tool like MailTester’s real-time verification API to confirm the status. If the address is truly invalid, you remove it from your list.
From bounce to action: automation and reputation protection
Automating this process reduces manual review and speeds up list cleanup. You’re not waiting days to see a high bounce rate in your dashboard—you’re reacting in real time as bounces happen.
According to RFC 6522, persistent delivery failures signal poor list hygiene and can trigger sender reputation penalties from major providers like Gmail and Outlook. That’s why catching bounces early is non-negotiable.
MailTester integrates with systems that receive Mailgun webhooks, so you can verify addresses on the fly. For larger campaigns, bulk verification via MailTester’s bulk list verification can help you clean your database before sending. This reduces the risk of your messages being flagged or blocked.
By linking Mailgun’s webhook to your verification stack, you make deliverability not just reactive, but proactive. You’re not just tracking bounces—you’re preventing them from ever happening in the first place. That’s the difference between maintaining reputation and recovering from damage.
How to use Mailgun’s webhook to detect spam complaints
When a recipient marks one of your Mailgun-sent emails as spam, Mailgun triggers a complaint event and sends it via webhook. You can capture this event, correlate it with the original sender address, and use tools like MailTester to verify whether that address is still valid, risky, or invalid. Repeated complaints from the same address often reveal issues with content, timing, or targeting.
How Mailgun’s complaint event works
Mailgun’s inbound complaint events are part of its email delivery reporting system. When a recipient’s email client or provider flags your message as spam, the complaint is relayed through Mailgun’s infrastructure and delivered to your webhook endpoint. The event includes the email address, timestamp, and details on the complaint type (e.g., "spam," "abuse"). This data gives you real-time visibility into user sentiment.
These events follow industry standards for abuse reporting, like RFC 6653, which defines how complaint notifications should be structured. The format ensures interoperability across email providers and services. You can use tools like Spamhaus or MxToolbox to cross-check whether the reported addresses are known sources of spam, adding another layer of context.
Correlating complaints with email verification
Let’s say you receive a complaint from [email protected]. You can check that same email against MailTester’s real-time verification API — API Email Checker — to see if the address is valid, risky, or invalid. If it shows as “invalid” or “catch-all,” that’s a red flag: the complaint came from a dead or low-quality address, possibly indicating outdated list hygiene.
If the address checks out as valid but you’re seeing multiple complaints, the issue is likely content-related. High complaint rates from legitimate users suggest your messaging is off-target, overly promotional, or not aligned with user expectations. Use this insight to refine subject lines, frequency, or segmentation.
MailTester helps you spot these patterns at scale. For large lists, run bulk verification — bulk email verification — to uncover risky or dormant addresses before sending. You can also test inbox placement with inbox placement testing, simulating real-world delivery across major mailbox providers. This gives you confidence in your deliverability pipeline.
Setting up this workflow doesn’t require deep expertise. Mailgun’s webhook documentation is straightforward. Combine it with MailTester’s reliable results — 98.9% accuracy in detecting deliverability risks — and you get a precise, actionable signal. Monitor complaints, verify sender addresses, and reduce your overall spam score, not just in real time, but with measurable confidence. Learn more about how this works at MailTester’s pricing page.
Using webhook data to identify invalid or risky email addresses
When Mailgun’s webhook confirms a message was delivered, but MailTester flags the address as catch-all or risky, that email was accepted by the server but isn’t guaranteed to be valid. If the same address later triggers a bounced or complaint event in Mailgun’s webhooks, MailTester automatically marks it for removal. This feedback loop between delivery confirmation and real-world outcome helps you keep your list clean before sending resumes.
Deliverability signals don’t confirm validity
Many email servers accept messages for catch-all addresses—ones that accept mail for any user part—to avoid revealing invalid addresses. This means a delivered webhook event doesn’t guarantee the recipient actually exists. You might deliver a message to a mailbox that doesn’t belong to anyone, or worse, to an inbox that’s never checked.
MailTester checks for these patterns during bulk verification. It detects when an address is likely to be a placeholder, an old alias, or a high-risk setup. When combined with Mailgun’s webhook data, this tells you exactly which delivered messages were delivered to dead ends.
For example, if Mailgun reports delivery to [email protected], but MailTester’s pre-check says “catch-all,” you’re sending to a potential trap. If that same address later generates a bounce, you now have a clear record: a delivery that wasn’t a real interaction. That data tells you to remove it permanently.
Two-phase feedback sharpens list hygiene
Using webhook events and post-delivery verification creates a two-phase system. The first phase—Mailgun’s delivery confirmation—tells you an address was processed. The second phase—MailTester’s behavioral analysis—tells you how that address performed in practice.
When a delivered event is later followed by a bounced or complaint status, MailTester adds that address to a flagged list. You can use this insight to refine your suppression list. It’s not just about blocking hard bounces anymore—it’s about catching the ones that look like they work but really don’t.
This approach is industry-standard: The Spamhaus Project and RFC 5321 both recognize that delivery does not equal engagement. You’re not just validating syntax and server response—you’re catching email addresses that harm deliverability over time.
For deeper testing, try inbox placement tests to see how your campaigns perform across real inboxes. Or, for ongoing list management, use the bulk verification tool or real-time API to clean up before you send.
Real-time email verification using the MailTester API
You can verify individual email addresses in real time using the MailTester API before sending, applying the same validation logic that confirms addresses passed Mailgun’s webhook event checks. The API returns results instantly—valid, invalid, catch-all, or risky—so you know exactly which addresses are safe to send to, reducing bounces and protecting sender reputation. No waiting, no guesswork.
How to integrate real-time verification into your workflow
- Send a request to the MailTester API with the email address you want to check. Use your API key and the standard endpoint at https://mailtester.com/api-email-checker. This step runs the same checks used for bulk verification, including MX record lookup, syntax validation, and role account detection.
- Parse the response immediately. The API returns one of four verdicts:
valid,invalid,catch-all, orrisky. Avalidaddress is likely to receive your message. Aninvalidaddress won’t accept mail. Acatch-allmay accept mail but indicates poor list hygiene. Ariskyaddress could be a disposable or temporary email, or one with a high bounce rate. - Use the results to filter your send list. If an email is marked as invalid or risky, exclude it from your campaign. This reduces hard bounces and prevents your sender score from degrading. As noted in RFC 5321, consistent validation helps maintain SMTP reliability and improves long-term deliverability.
- Apply the same logic to addresses that passed Mailgun’s webhook. If your webhook logs a “delivered” or “hard bounce” event, verify the address against MailTester’s real-time database to confirm its current status. This ensures you’re not sending to addresses that were once valid but have since become inactive.
- Scale with bulk validation when needed. For large lists, use the bulk verification tool to catch invalid or risky addresses before sending. The same validation logic applies—no exceptions.
Why this works even when Mailgun’s webhook is not enough
Mailgun’s webhook tells you what happened after a send—but it doesn’t tell you what will happen when you send next. The MailTester API fills that gap with proactive validation. It checks syntax, domain status, and role account patterns. As a reminder from Spamhaus, role accounts (like admin@ or sales@) are often non-receivable or high-risk, and verifying them helps avoid deliverability penalties.
When you combine Mailgun’s event data with real-time verification, you get the full picture: past behavior and current eligibility. This reduces bounce rates, improves inbox placement, and protects your sender reputation. With 100 free verifications to start and purchased credits that never expire, there's no risk in testing it.
How MailTester’s AI assistant helps interpret webhook feedback
You can ask MailTester’s AI assistant to analyze patterns in your verified email list and real-time webhook events—from sudden drops in deliverability to repeated catch-all responses—then get a clear breakdown of anomalies. It doesn’t just alert you; it explains why, using behavioral context from your send history, domain reputation, and inbox placement data.
Spotting hidden trends in deliverability signals
Let’s say your Mailgun webhook shows a sudden spike in "soft bounces" or "delayed" statuses. The AI assistant cross-references this with prior delivery patterns and bulk verification results. If it detects a cluster of addresses from a specific domain showing inconsistent responses—like some delivering, others blocked—it flags this as a potential greylisting or IP reputation issue. You’re not guessing. You’re seeing the pattern.
This matters because inconsistent delivery often points to backend issues: your IP might be in a temporary blocklist, or the recipient server is throttling your rate. The AI checks known indicators like sending volume spikes, content similarity, and authentication setup—factors tied to industry best practices documented by RFC 5322 and monitored by platforms like MxToolbox.
Ask for answers, not just data
Instead of digging through logs, ask: “Which emails were delivered but never opened?” The AI pulls from your webhook delivery reports and inbox placement tests—even those that hit the spam folder—to isolate a list of addresses that received your email but never engaged. You can then exclude them from future campaigns or adjust your content.
It works because MailTester ties verification results (valid, catch-all, risky) directly to delivery events. If a catch-all responds in real time, that’s logged. If a verified domain shows repeated undelivered messages, it’s tied back to its original validation score. The AI surfaces this data not as noise, but as decisions: “Remove high-risk domains from your next send.”
Use this insight across your workflow. After bulk verification with MailTester’s verification tool, integrate your Mailgun webhook data to build a self-updating, high-confidence list. The AI doesn’t replace judgment—it sharpens it, using real behavioral traces to reduce guesswork.
For ongoing checks, pair this with real-time inbox placement testing at MailTester’s inbox tester to see how your message lands across major providers. You’ll know when changes matter, not just that something changed.
How to set up automated list cleaning with Mailgun and MailTester
You can automate email list hygiene by verifying addresses before sending with MailTester's API, then using Mailgun’s delivery webhook to flag failed sends in real time. Run weekly bulk checks to purge invalid addresses upfront, and combine that with post-send filtering to catch new bounces or greylisted domains. This two-stage process reduces waste, preserves sender reputation, and improves inbox placement.
Pre-send verification: clean lists before delivery
- Use MailTester’s real-time verification API to check your entire list before each campaign.
- Set a weekly cron job to run bulk verification on your subscriber database.
- Filter out invalid, catch-all, and risky addresses—these fail outright or harm your sender reputation.
- Store verified addresses in your CRM or ESP, and exclude the rest from future sends.
Post-send monitoring: react to delivery events
- Configure Mailgun’s delivery webhook to trigger on every send event—delivered, bounced, or blocked.
- When a bounce event comes in, use the email address to trigger a fast validation check via MailTester’s API.
- Update your list in real time: mark the address as invalid if MailTester confirms it.
- Combine both systems: verify before sending, and validate again after delivery to catch soft bounces or role accounts that slipped through.
Deliverability isn’t just about sending—it's about adapting to feedback. A single hard bounce can hurt your reputation; a delayed response to it compounds the risk.
Use tools like Spamhaus and MXToolbox to check whether known spamhaus or blocklisted domains appear in your list. These services help you spot patterns—like high volumes of @mailinator.com or @fake.com—that no verification tool can catch fully.
MailTester’s 98.9% accuracy doesn’t mean zero false positives. Some valid addresses may be flagged as risky due to greylisting or temporary server issues. But combining pre-send checks with post-send events closes gaps that pure timing-based models miss.
Start with 100 free verifications at MailTester’s pricing page, then scale as your list grows.
The practical impact of this integration on deliverability
When you combine Mailgun’s delivery logs with MailTester’s 98.9% accurate email verification, you’re not just checking if an address exists—you’re confirming whether it actually lands in the inbox. This dual verification cuts through false positives, stops bounces before they happen, and keeps your sender reputation intact. The result? Real inbox placement, not just delivery attempts.
Proactively avoid deliverability pitfalls
You don’t need to wait for bounce reports to know a list is broken. With Mailgun’s webhook feeding real-time delivery events into MailTester, you catch invalid, catch-all, or risky addresses before sending. This means fewer hard bounces, fewer spam traps, and less risk of being flagged by major inbox providers.
MailTester’s verification engine uses a mix of SMTP checks, pattern detection, and real inbox testing—so when it says an address is valid, it’s not just a syntax match. It’s backed by actual delivery behavior. You can test inbox placement directly using MailTester’s tools to see how your messages perform across Gmail, Outlook, and Apple Mail (Return Path, 2023). That visibility turns guesswork into control.
Drive real engagement through clean data
Every email you send that actually reaches an inbox is a chance to engage. By filtering out dead or risky addresses, you improve open rates and response rates. No more wasted sends to addresses that aren’t even functional—or worse, to domains that block you.
Mailgun’s webhook lets you automate this check: every new address added to a list can trigger a real-time verification via MailTester’s API. This is where you get the most value—scaling verification without slowing down your campaigns. Use the MailTester API to embed verification directly in your onboarding, signup, or batch processing workflows.
Over time, your sending behavior becomes consistent, and inbox providers take notice. A stable, low-bounce history reduces the chance of being sent to quarantine or blocked. You avoid domain blacklists, maintain sender reputation, and increase inbox placement across major providers.
Why MailTester works better with Mailgun than basic validation tools
Most email verification tools only check syntax or whether an address exists on a mail server. They don’t confirm if an email actually reaches the inbox.
MailTester goes further. It performs SMTP-level validation and runs real inbox placement tests. Unlike ZeroBounce, NeverBounce, Kickbox, Bouncer, Hunter, Emailable, or MillionVerifier — which rely on heuristics and incomplete data — MailTester validates deliverability using actual delivery feedback from real mailboxes.
This level of accuracy — 98.9% — combined with a real-time API, makes MailTester the trusted instrument for high-stakes senders using Mailgun. You’re not just cleaning lists. You’re improving inbox placement and sender reputation where it matters.
Keep reading
- Deliverability testing inside your ESP, CRM and sending platform (complete guide)
- Step-by-Step Guide to Email Deliverability Testing with Constant Contact
- How to Monitor Klaviyo Email Deliverability Using Third-Party Verification
- Email Deliverability Testing in Marketo via Automated Verification
- Best Practices for Email Deliverability Testing in ActiveCampaign
Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
Can I use MailTester with Mailgun’s webhook for real-time verification?
Yes. MailTester accepts Mailgun webhook events and uses them to verify actual delivery outcomes. Combined with its API, you get real-time email verification and deliverability feedback.
Does using Mailgun’s webhook improve email deliverability?
Not by itself. But when paired with MailTester, webhook data helps identify invalid addresses and delivery issues early—reducing bounces and spam complaints.
How does MailTester handle catch-all email addresses?
It flags them as 'risky' or 'catch-all' based on SMTP-level response. Catch-all addresses may accept emails but often aren’t real people. MailTester helps you filter them out.
Can I verify emails before sending using Mailgun and MailTester?
Yes. Use MailTester’s real-time verification API to check an email address before sending. This is best done in parallel with webhook event monitoring.
What is the accuracy of MailTester’s email verification?
MailTester’s email verification is 98.9% accurate. It uses real SMTP checks and inbox placement tests to confirm deliverability, not just syntax or domain existence.
Does MailTester work with other email service providers?
Yes. MailTester integrates with Mailchimp, HubSpot, Klaviyo, and SendGrid. It’s designed to work with any platform that supports real-time event delivery.
How do I get started with free verifications on MailTester?
Start with 100 free verifications. No expiry on purchased credits. Use them to verify your list and test deliverability before sending.
Can MailTester detect disposable email domains?
Yes. It identifies known disposable domains during validation and flags them as 'risky' or 'invalid'. This helps keep spam traps and fake accounts out of your list.
How does MailTester help with sender reputation?
By identifying and removing invalid, risky, or bounced addresses, MailTester helps maintain a clean sender reputation and reduces spam trap exposure.
Can I test inbox placement without sending emails?
Yes. MailTester offers inbox-placement testing that simulates delivery without sending actual messages. This helps assess deliverability risk before campaigns go live.
Is there a downside to using webhook events for verification?
Yes—only delivered or bounced emails are processed. Open and click events don’t confirm inbox placement. You must combine webhook data with direct verification to be confident.
Does MailTester store my email list data?
No. MailTester does not store lists. All verification results are based on real-time checks and are not retained beyond the session unless you choose to export them.