Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SES Transport fails on sending a batch immediately #9644

Closed
mabumusa1 opened this issue Feb 4, 2021 · 9 comments
Closed

AWS SES Transport fails on sending a batch immediately #9644

mabumusa1 opened this issue Feb 4, 2021 · 9 comments
Assignees
Labels
bug Issues or PR's relating to bugs email Anything related to email email-integrations Anything related to integrations with mail providers. Plugins have a separate label! regression A bug that broke something in the last release stale Issues which have not received an update within 90 days T3 Hard difficulty to fix (issue) or test (PR)

Comments

@mabumusa1
Copy link
Member

mabumusa1 commented Feb 4, 2021

Bug Description

The more details the better...

Q A
Mautic version 3.2.5
PHP version 7.4
Browser

Steps to reproduce

  1. Make sure you are sending using immediate mode
  2. Create a segment with more than 50 contacts
  3. Send an email to that segment
  4. The email will be failed to send
  5. There is a related error for throttling (logs below)

Log errors

[2021-02-03 08:01:33] mautic.ERROR: [MAIL ERROR] Token amount (51) is larger than the capacity (3). (send); {"exception":"[object] (Swift_TransportException(code: 0): Token amount (51) is larger than the capacity (3). at app/bundles/EmailBundle/Swiftmailer/Transport/AbstractTokenArrayTransport.php:300)"} []

[2021-02-05 08:25:00] mautic.ERROR: [MAIL ERROR] Expected response code 250 but got code "454", with message "454 Throttling failure: Maximum sending rate exceeded. " (send); email@domain.com {"exception":"[object] (Swift_TransportException(code: 454): Expected response code 250 but got code \"454\", with message \"454 Throttling failure: Maximum sending rate exceeded.\r\n\" at /home/smartconnectamba/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:457)"} []

Solution to be implemented must look into the following lines:

        if (!$this->started) {
            $this->amazonClient  = $this->createAmazonClient();

            $account             = $this->amazonClient->getAccount();
            $emailQuotaRemaining = $account->get('SendQuota')['Max24HourSend'] - $account->get('SendQuota')['SentLast24Hours'];

            if (!$account->get('SendingEnabled')) {
                $this->logger->error('Your AWS SES is not enabled for sending');
                throw new \Exception('Your AWS SES is not enabled for sending');
            }

            if (!$account->get('ProductionAccessEnabled')) {
                $this->logger->info('Your AWS SES is in sandbox mode, consider moving it to production state');
            }

            if ($emailQuotaRemaining <= 0) {
                $this->logger->error('Your AWS SES quota is currently exceeded, used '.$account->get('SentLast24Hours').' of '.$account->get('Max24HourSend'));
                throw new \Exception('Your AWS SES quota is currently exceeded');
            }

            $this->concurrency   = floor($account->get('SendQuota')['MaxSendRate']);

            $this->started = true;
        }
@mabumusa1 mabumusa1 added bug Issues or PR's relating to bugs regression A bug that broke something in the last release email Anything related to email labels Feb 4, 2021
@mabumusa1 mabumusa1 self-assigned this Feb 4, 2021
@RCheesley RCheesley added T3 Hard difficulty to fix (issue) or test (PR) email-integrations Anything related to integrations with mail providers. Plugins have a separate label! labels Feb 26, 2021
@RCheesley
Copy link
Sponsor Member

Thanks for flagging up this issue @mabumusa1 - are you able to work on this or should we find someone to fix this?

@mabumusa1
Copy link
Member Author

@RCheesley I am working on a solution for it.

@RCheesley
Copy link
Sponsor Member

RCheesley commented Feb 26, 2021

Amazing - thanks for letting us know!

@mabumusa1
Copy link
Member Author

Thanks for flagging up this issue @mabumusa1 - are you able to work on this or should we find someone to fix this?

The fix is on the attached PR

@stale
Copy link

stale bot commented May 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues which have not received an update within 90 days label May 30, 2021
@stale
Copy link

stale bot commented Jun 13, 2021

This issue has been automatically closed because it has not had recent activity. If the reported issue persists, please create a new issue and link back to this one for reference. Thank you for your contributions.

@stale stale bot closed this as completed Jun 13, 2021
@mabumusa1 mabumusa1 reopened this Nov 20, 2021
@stale stale bot removed the stale Issues which have not received an update within 90 days label Nov 20, 2021
@stale
Copy link

stale bot commented Feb 18, 2022

This issue or PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like to keep it open please let us know by replying and confirming that this is still relevant to the latest version of Mautic and we will try to get to it as soon as we can. Thank you for your contributions.

@stale stale bot added the stale Issues which have not received an update within 90 days label Feb 18, 2022
@stale
Copy link

stale bot commented Mar 5, 2022

This issue or PR has been automatically closed because it has not had recent activity. In the case of issues, if it persists in the latest version of Mautic, please create a new issue and link back to this one for reference. With PRs if you wish to pick up the PR and update it so that it can be considered for a future release, please comment and we will re-open it. Thank you for your contributions.

@stale stale bot closed this as completed Mar 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If this issue is continuing with the lastest stable version of Mautic, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs email Anything related to email email-integrations Anything related to integrations with mail providers. Plugins have a separate label! regression A bug that broke something in the last release stale Issues which have not received an update within 90 days T3 Hard difficulty to fix (issue) or test (PR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants