Why are Mailgun logs showing emails from unexpected sources using my dedicated IP?
Matthew Whittaker
Co-founder & CTO, Suped
Published 6 May 2025
Updated 17 Aug 2025
7 min read
Discovering unexpected emails in your Mailgun logs, seemingly from your dedicated IP but not originating from your sending account, can be alarming. It creates a natural concern about unauthorized use and potential damage to your sending reputation. When you see messages from dubious senders, such as those impersonating well-known entities, it indicates a significant issue that requires immediate attention.
This situation often points to a misunderstanding of how Mailgun processes inbound email, especially when combined with a dedicated IP and specific routing configurations. While the emails might appear in your logs, the key is to determine if they are outbound messages illicitly sent through your infrastructure or inbound messages being processed by Mailgun's receiving services.
Inbound email processing with Mailgun
When using a service like Mailgun, it's crucial to understand the distinction between sending and receiving emails. While it's primarily known for outbound email delivery, Mailgun also offers robust features for handling inbound messages. This means that if your domain's MX records point to Mailgun, it will receive emails sent to your domain.
Mailgun’s routes are designed to process these incoming messages, allowing you to forward them, store them, or trigger webhooks. If a route is configured to forward an incoming email to another address, Mailgun uses your dedicated IP to send that forwarded message. This re-sending (forwarding) action is logged, and it can indeed appear as if the email originated from your IP, even though the initial sender was external and potentially malicious.
This functionality is often the root cause of confusion when you observe unexpected entries in your Mailgun logs. The system is simply doing what it was configured to do: receive mail for your domain and then, based on your routes, process and potentially re-send it using your dedicated IP. Understanding this inbound processing is the first step in diagnosing why these seemingly unexpected emails are appearing.
A good way to confirm if your logs are showing inbound activity is to look for the event type in the Mailgun logs. For instance, an accepted event for an inbound route means Mailgun received the email. If that email is then forwarded, it generates a new delivered event using your IP.
Understanding log event types
Mailgun logs provide details on email events. An accepted event indicates Mailgun has received the message for processing. A delivered event means Mailgun successfully sent the message to its final destination, receiving a 250 OK response from the recipient server. For inbound routes, a delivered event can refer to the forwarding action from your dedicated IP.
Common causes for unexpected log entries
The appearance of emails from domains like YouPorn, Biden & Harris, or the Washington Post in your Mailgun logs, supposedly from your dedicated IP, is a classic sign of unsolicited inbound email, often spam or backscatter. Spammers frequently spoof sender addresses to make their emails appear legitimate or to evade simple filters.
If your Mailgun setup includes inbound routing for your domain and a catch-all address, it means Mailgun is accepting all emails sent to your domain, regardless of the recipient address. When these emails, including spam, are then forwarded via your Mailgun routes, they appear in your logs as being sent from your dedicated IP. This isn't necessarily an indication of your dedicated IP being compromised, but rather your Mailgun receiving service doing its job.
However, this scenario does highlight a potential issue if these unexpected emails are consuming your sending limits or negatively impacting your IP reputation. While your catch-all might block them internally, the act of receiving and processing (and then blocking) a large volume of spam can still contribute to unwanted log entries. If you're seeing spam spikes, it could be tied to this inbound processing. For more on this, review our guide on spam spikes in Google Postmaster Tools.
These logs are a form of backscatter. Authenticating your account and understanding the flow of emails through your Mailgun setup is key to resolving this. This includes ensuring your email authentication records like DMARC, SPF, and DKIM are correctly configured, which helps prevent spammers from exploiting your domain for their malicious activities.
The risk of unmanaged inbound spam
Even if your catch-all is blocking spam internally, the constant processing of unsolicited emails through your dedicated IP can still negatively impact its reputation. ISPs and blocklists (or blacklists) observe traffic patterns. High volumes of perceived backscatter or suspicious inbound activity being forwarded can lead to your dedicated IP being flagged or even placed on a blocklist. This can result in legitimate emails landing in spam folders or being rejected.
Steps to investigate and secure your setup
To confirm if unexpected logs are due to inbound routing, the first step is to review your Mailgun control panel. Navigate to the Receiving section and check your configured routes. Look for any routes that process incoming emails for your domain and then forward them. This is often the culprit when you see seemingly outbound emails that you didn't initiate.
Next, verify your DNS records, particularly your MX (Mail Exchange) records. Ensure they are correctly configured and only point to Mailgun if you intend for Mailgun to handle your inbound mail. Misconfigured MX records can inadvertently direct unwanted mail to your Mailgun setup. If your domain's MX records are pointing to Mailgun, it means Mailgun is configured to receive emails for your domain.
Finally, implement or strengthen your DMARC policy. A DMARC policy with p=quarantine or p=reject will instruct recipient mail servers on how to handle emails that fail DMARC authentication for your domain. This can significantly reduce the amount of spoofed mail hitting your domain and subsequently being processed (and logged) by Mailgun. We have a simple guide for simple DMARC examples.
For a comprehensive check, you might also consider what to do if an unexpected IP appears in your Google Postmaster Tools dashboard, as this often indicates related issues with your sender reputation.
Preventing future incidents and maintaining reputation
Maintaining a healthy email reputation, especially with a dedicated IP, requires ongoing vigilance. Beyond configuring your inbound routes and DMARC policy, regular monitoring is essential. Regularly check your Mailgun logs for any unusual patterns or unexpected senders, regardless of whether they are blocked by your catch-all.
Ensure your SPF and DKIM records are always accurate and up-to-date. Small changes in your email sending infrastructure or DNS can sometimes lead to authentication failures, which then impact your deliverability and could exacerbate issues with unexpected log entries. This is particularly important for avoiding DMARC verification failures.
Additionally, consider implementing automated alerts for suspicious activity within your Mailgun account. This proactive approach allows you to identify and address potential issues quickly before they escalate and impact your dedicated IP’s reputation. Remember, a dedicated IP's reputation is entirely yours to build and maintain, making vigilance key to consistent email deliverability.
The problem
Misinterpreted logs: Logs show emails from unknown sources appearing to originate from your dedicated IP, causing concern about unauthorized use.
Spam and backscatter: Malicious emails using spoofed sender addresses are being received by your Mailgun setup.
Reputation risk: Even if blocked, processing high volumes of spam can negatively affect your dedicated IP's sender reputation and lead to blacklisting.
The solution
Understand inbound routing: Recognize that Mailgun uses your dedicated IP to forward emails received via its inbound MX, making external emails appear as if sent by you.
Review Mailgun routes: Check and optimize your Mailgun routes in the Receiving section to control what is forwarded.
Implement strong DMARC: Use a DMARC policy (p=quarantine/reject) to prevent spoofed emails and reduce unwanted inbound traffic.
Monitor and verify: Regularly check logs and monitor blocklists for your dedicated IP to maintain a healthy reputation.
Summary
Identifying unexpected emails in your Mailgun logs, especially when using a dedicated IP, usually points to inbound mail processing rather than an unauthorized outbound breach. By understanding Mailgun's inbound routing capabilities, carefully reviewing your configured routes, and strengthening your domain's email authentication, you can gain clarity and control over your email flow.
Proactive monitoring and a robust DMARC policy are your best defenses against unwanted traffic impacting your dedicated IP's reputation. Taking these steps will help ensure that your Mailgun logs accurately reflect your sending activity and that your legitimate emails reach their intended inboxes without issue.
Views from the trenches
Best practices
Always check your Mailgun 'Receiving' routes if you see unexpected inbound-looking traffic.
Implement a DMARC policy at 'quarantine' or 'reject' to protect your domain from spoofing.
Regularly monitor your Mailgun logs to spot unusual patterns or senders.
Ensure your domain's MX records correctly reflect your intention for inbound mail handling.
Common pitfalls
Misinterpreting inbound mail forwarding as unauthorized outbound sending.
Leaving catch-all email addresses active without robust filtering.
Failing to enforce strong DMARC policies, allowing spoofed emails.
Neglecting regular audits of Mailgun routes and DNS configurations.
Expert tips
If Mailgun support isn't sure, provide them with specific log examples.
Verify if your domain's MX records point to Mailgun for inbound handling.
Consider the impact of high volumes of inbound spam on your dedicated IP's overall reputation.
Remember that a 'delivered' status in Mailgun logs can mean a forwarded inbound email.
Expert view
Expert from Email Geeks says to confirm what type of logs are being reviewed, as they might be inbound logs.
2023-08-30 - Email Geeks
Marketer view
Marketer from Email Geeks says that Mailgun's 'accepted' status means the message was taken for processing, and 'delivered' means it received a 200 OK from the destination server.