Article Preview
Overview
Yes, we will do so upon a default retry schedule (detailed below) that is executed during a default retry window (a period of time in which all delivery attempts will be made). The retry window, however, can be customized so that time-sensitive messages do not continue retrying for a long period of time.
Understanding message failures
Messages that fail to deliver due to permanent failures will not be retried. Examples of permanent failures are:
- The recipient address does not exist
- The recipient server has blocked delivery (for various reasons)
- Mailbox full
- In general, any 5xx error we receive from the recipient server
Messages that fail to deliver due to temporary failures will be retried according to the retry schedule outlined below. Examples of temporary failures are:
- Message deferrals / throttling / rate limiting by the recipient server
- Transient recipient server issues
Delivery retry schedule
For messages that are retried, Mailgun will re-attempt delivery in increasing intervals for a maximum of 8 hours until the message is either delivered, results in a permanent failure, or reaches the retry expiration.
The retry schedule intervals are:
- After the first temporary failure, the message is queued and delivery is reattempted 10 minutes afterwards
- For the second failure, the interval increases to 15 minutes
- For the third failure, the interval increases to 30 minutes
- For the fourth failure, the interval increases to 1 hour
- For the fifth failure, the interval increases to 2 hours
- For the sixth failure, the interval increases to 4 hours
In sum, this means the default retry window is up to 8 hours in length.
As for delivery retry expiration, if a message fails to deliver after the 8 hour retry schedule outlined above, Mailgun will drop the message and generate a permanent failure with the description of "Too old".
Delivery retry windows
As mentioned above, the retry window (default) is up to 8 hours in length.
Nonetheless, you may have a use case that requires a different approach to delivery retries, such as needing to send (and retry as necessary) time-sensitive emails with OTPs or short-lived links that expire in minutes. In such cases, a retry schedule that stretches delivery attempts over possibly 8 hours would result in recipients receiving messages with expired, unusable links. As such, Mailgun provides the option to customize the retry window although the retry schedule will remain the same.
A particular API parameter and SMTP header will allow you to define the maximum retry window (see the linked documentation for the API parameter and SMTP header for further details):
-
API parameter:
o:deliver-within -
SMTP header:
X-Mailgun-Deliver-Within
These accept a duration value between 5 minutes and 24 hours. When used, a deliver-by field is added to accepted event with the deadline that you specified.
Please be aware that the default retry schedule applies within this retry window, which means that shorter timeframes may result in fewer delivery attempts.
For example, if you set the parameter to 15 minutes, we will attempt the initial delivery; and if the delivery experiences a temporary failure, we will perform a single retry 10 minutes later. As such, a maximum of only two attempts are executed by the delivery retry schedule due to the value of 15 minutes established for the customized retry window.
Need Support?
Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support page of your Mailgun Control Panel, and we'll be with you shortly!