Amazon SES: Number of sent emails differs

Your software
My Mautic version is: 5.2.3
My PHP version is: 8.2.26
My Database type and version is:

Your problem
My problem is: Count of emails in Amazon SES is 160, Mautic says 1100. How do I find out if all emails are sent

These errors are showing in the log:

Steps I have tried to fix the problem:

1 Like

I gave it another try. This time, AWS shows 410 messages sent. Mautic shows, 1282 sent.
My AWS account limit is 100k and 50/s.

I have no clue if the difference between the two numbers was sent or not.

I’m using the mautic-consumer.service from @joeyk for sending the emails out of the DB queue.

My mauticcron.sh looks like this:
#!/bin/bash

MAUTICCONSOLE=“/var/www/mautic/bin/console”

    php $MAUTICCONSOLE mautic:campaigns:rebuild --batch-limit=300
    php $MAUTICCONSOLE mautic:segment:update --batch-limit=900
    php $MAUTICCONSOLE mautic:campaigns:trigger --campaign-limit=50
    php $MAUTICCONSOLE mautic:import --limit=5000
    php $MAUTICCONSOLE mautic:webhooks:process
    php $MAUTICCONSOLE mautic:reports:scheduler
    php $MAUTICCONSOLE mautic:broadcast:send --batch=5 --limit=500

Any hint how I can improve on this?

Do I need the -batch option?

Many thanks

Christian

You may also test with:

GitHub - twentyZen/mautic-cronjobs: This script and environment file helps to manage cron jobs for Mautic. (but adjust your parameters in the .env for your environment).

Otherwise you may test with smtp. If numbers are correct then, it will be related to batched sending. You may have hit a limit?

(Do you use virtual mail delivery manager? It may have delayed sending?)

Many thanks Dirk,

I will test some more.

Is the twentyZen working out of the box with a consumer-service daemon for the consuming command, or do I have to adapt something like the last line in the script:
COMMAND_QUEUE=“messenger:consume email --limit=$EMAILS_PER_BATCH --time-limit=$QUEUE_TIME_LIMIT|true”

Having a sending rate of 50 emails per second, It should be okay to change
EMAILS_PER_BATCH=14 to 50

and ignore the following values:

Email settings (Batch size needs to be adjusted to your mail service, if you send without queue)

BROADCASTS_BATCH_LIMIT=50
BROADCASTS_SEND_LIMIT=560

Command limits

SEGMENTS_UPDATE_LIMIT=900
CAMPAIGNS_REBUILD_LIMIT=300
IMPORT_LIMIT=500

and it should work, correct?

Mana thanks

Christian

The whole concept is based on cron jobs triggering the script. It reads the .env file and loops through all activated commands. E-Mail handling is a special loop, as it loops as long as there are mails in the queue up to the max.

You may look into timing. I loop through it by batches and adds the defined delay. Actually in the example it adds 1 sec in each loop to make sure its really not sending more than batch size in a second. This might be inefficient, if sending 50 mails already takes more than a second with this looping script. Delay could then be 0.

Thats why it always may need some adjustment.

Next level could really be to adjust it to a running daemon that sends continuously. I just don’t know the implications and how to control the speed of sending of the daemon.

Thanks Dirk,

I set up the daemon, according to @joeyk, documentation here:

I’ll figure it out somehow.

Kind regards

Christian

If you have changes that will support the daemon, please let me know.

1 Like