Test mails rejected by sandbox domain are requeued endlessly

Created on 8 March 2023, over 1 year ago
Updated 16 February 2024, 5 months ago

Problem/Motivation

When sending mails to a sandbox test domain through MailgunMail::queueMessage() the mail will be rejected by the sandbox domain unless the recipient is in the allowed list, with the following error:

Domain sandbox.mailgun.org is not allowed to send: Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.

The mail is currently not removed from the queue so it will be resent again and again on the next cron run. This results in an endless stream of errors.

Steps to reproduce

  1. Configure the module to use a sandbox domain.
  2. Queue a message to a recipient which is not listed as an "authorized recipient" in the sandbox domain.

Result: the mail is rejected by the sandbox and is sent again and again on every cron run.

Expected result: the mail is rejected by the sandbox and is not sent again.

Proposed resolution

When the Mailgun API indicates in their error message that the mail is rejected due to being sent through a sandbox domain, the message should be removed from the queue.

Remaining tasks

First we need to fix ✨ MailgunHandlerInterface::sendMail() should throw exceptions on error Active before this can be implemented.

πŸ› Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024