Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mailgun: Messages "Accepted" but taking long time to be delivered (or not being delivered)

Tags:

email

mailgun

I'm using Mailgun for a site I maintain, usually Mailgun works great, but I am encountering a strange problem. My script calls the HTTP API to send messages using Mailgun, these then show up in my log as being "accepted", but then take a very long time to be "delivered", often failing to be delivered at all and simply remaining as "accepted". Has anyone experienced a similar error or could anyone suggest a way to fix it? I'm guessing it's in the arguments supplied to the API but I can't for the life of me figure out the problem.

The problem exists for different recipient domains and different times of day.

The JSON log of a problematic message is below. I have, of course, changed addresses and domains.

{     "tags": [],      "timestamp": 1411498829.247304,      "envelope": {         "targets": "[email protected]",          "transport": "",          "sender": "[email protected]"     },      "recipient-domain": "address.com",      "event": "accepted",      "campaigns": [],      "user-variables": {},      "flags": {         "is-authenticated": true,          "is-system-test": false,          "is-test-mode": false     },      "message": {         "headers": {             "to": "[email protected]",              "message-id": "[email protected]",              "from": "\"the-site-in-question.com\" <[email protected]>",              "subject": "Dom, your password was reset."         },          "attachments": [],          "recipients": [             "[email protected]"         ],          "size": 556     },      "recipient": "[email protected]",      "method": "http" } 
like image 558
Dom Weldon Avatar asked Sep 24 '14 09:09

Dom Weldon


People also ask

How long does it take for Mailgun to send email?

As soon as your email is accepted by Mailgun, we'll initiate the first delivery attempt, sending 99% of messages in less than five minutes of receipt. Whether you need to send 15,000 messages per hour or 15 million, we can guarantee that sending rate with the Rapid Fire Delivery SLA.

How do I check my Mailgun messages?

This post was originally published in 2016. 3. After finding the message you want to see, click on the settings and select 'show message. ' There you go!

How many emails can I send with Mailgun?

There is a limit of 300 messages per day on the included sandbox domain. Data retention for Logs and the Events API is 1 day. You cannot create custom domains. You can only send to Authorized Recipients; and there is a maximum of 5 Authorized Recipients.

Can you receive emails with Mailgun?

You can define a list of routes to handle incoming emails and prioritize the sequence of their execution. Each route consists of a filter expression and an action. When a message is received, Mailgun evaluates the filter expression against it.


1 Answers

If this is happening regularly, it is very likely Mailgun has you on one of their low-tier IP addresses. I imagine this is the default for free accounts, since they don't want to "pollute" their good addresses with new users who may not be serious / legit.

You can check the "quality" of the IP address at a site like Sender Score. Find this line in the Mailgun log of a delivered message:

"sending-ip": "XXX.XX.XXX.XXX" 

If Sender Score shows a score in the 70s, that's your problem. Send Mailgun a support ticket, as Chris suggested, and see if they can get you onto a higher quality IP address. I did so and my emails are now being sent from an IP address with a score in the 90s. Haven't had a single delay since.

like image 85
Greg Kaleka Avatar answered Oct 21 '22 09:10

Greg Kaleka