How to configure mautic 6.0.5 to use doctrine queues

Your software
My Mautic version is: 6.0.5
My PHP version is: 8.3
My Database type and version is: MariaDB 11.8.3

Current Status
I am currently using the “sync” scheme for sending e-mails directly to my SMTP service as soon as they are generated by the campaigns, and it works just fine.

Objective
I would like to go towards a more professional configuration so that mautic stores messages in doctrine queues and then sends them out at a slower pace using the “messenger:consume email“ cron tasks

Your problem
I tried to follow an older guide on this forum showing how to set up doctrine queues in mautic v5, but it seems I am still missing something out.
This is what I did:

  1. In mautic UI “Queue Settings”, in the “Queue for e-mail” section, I changed scheme to “doctrine”, and SMTP server hostname to “default”, so that the DSN line below reads “doctrine://default”
  2. I configured two cron jobs for, if I well understand, sending campaign/segment e-mails to the queue:
    * 8-18 1-5 sleep 0 && php bin/console mautic:messages:send -n >> /var/log/mautic/mautic-messages-send.log 2>> /var/log/mautic/mautic-messages-send-error.log
    *
    8-18 * * 1-5 sleep 0 && php bin/console mautic:broadcasts:send -n >> /var/log/mautic/mautic-broadcasts-send.log 2>> /var/log/mautic/mautic-broadcasts-send-error.log
  3. I configured an additional job to fetch messages from the queue and send them to the SMTP transport:
    * 8-18 * * 1-5 sleep 0 && php bin/console messenger:consume email -n --limit=10 --time-limit=30 --memory-limit=128M >> /var/log/mautic/mautic-messenger-consume-email.log 2>> /var/log/mautic/mautic-messenger-consume-email-error.log

But when I try to send a test message from the UI (Queue Settings), it won’t be delivered: it seems it is getting lost somewhere, and I don’t even know if the message ended up in the doctrine queue (should maybe check in the database table?).
By looking at the logs for the cron tasks above I get:

  • $ cat /var/log/mautic/mautic-messages-send.log | tail -n 10
    [2026-02-05 15:13:01] Processing message queue
    [2026-02-05 15:13:01] Messages sent: 0

  • $ cat /var/log/mautic/mautic-broadcasts-send.log | tail -n 10
    [2026-02-05 15:15:02] ±--------±-------±---------+
    [2026-02-05 15:15:02] | Channel | # sent | # failed |
    [2026-02-05 15:15:02] ±--------±-------±---------+

  • $ cat /var/log/mautic/mautic-messenger-consume-email.log | tail -n 30

  • $ cat /var/log/mautic/mautic-messenger-consume-email-error.log | tail -n 30
    [OK] Consuming messages from transport “email”.
    // The worker will automatically exit once it has processed 10 messages,
    // exceeded 128M of memory, been running for 30s or received a stop signal via
    // the messenger:stop-workers command.

    // Quit the worker with CONTROL-C.

    // Re-run the command with a -vv option to see logs about consumed messages.

So no error there, except that, to my surprise, the output “messanger-consume” job was logged in the error log instead of the standard one. It seems the process is terminating with a non-zero status code, maybe because the timeout elapsed without anything to send.

So my question is: what am I missing here?
Any idea?

I reply to my own topic here for a quick update.

The test message from mautic’s UI is still not being delivered, but I tried to launch a test campaign and those messages are being delivered! Manually sending an e-mail to a contact works too!

But I don’t know yet for sure whether the messages went through the doctrine queue or not.
It is hard to tell, since I can’t find any trace of the messages in the logs for any of the involved cron jobs:

  • mautic:messages:send
  • mautic:broadcasts:send
  • messenger:consume email

Next I’ll be looking in the queue’s table on the database.
Any idea or suggestion is welcome!

One more (last?) update on this on my side.

I launched another test campaign and have been monitoring the “messenger_messages” queue on the database by issuing the command:

sudo -u www-data php bin/console doctrine:query:sql “SELECT COUNT(*) FROM messenger_messages”

and I verified that messages are indeed landing there for some time until the “messenger:consume email” cron job consumes them and sends them out to the SMTP transport!

So I guess that’s all folks!

No, the previous one was not the last update on this topic :face_exhaling:

I thought I had managed to configure doctrine queues correctly, and my test campaign on a test segment with just one contact worked fine yesterday, but with mautic, nice little (but beautifully undocumented) piece of software, you can never call it a day!

I was waiting for a real campaign (~1000 contacts) to kick-in this morning and yes, it started as expected, loaded all contacts, scheduled sending e-mails and… stop! Nothing is going out to the SMTP transport.
No error in the logs for the involved cron jobs:

  • mautic:messages:send

    [2026-02-04 10:43:02] Processing message queue
    [2026-02-04 10:43:02] Messages sent: 0

    all the time

  • mautic:broadcasts:send

    [2026-02-05 11:18:01] ±--------±-------±---------+
    [2026-02-05 11:18:01] | Channel | # sent | # failed |
    [2026-02-05 11:18:01] ±--------±-------±---------+

    all the time

  • messenger:consume email

    [OK] Consuming messages from transport “email”.

    // The worker will automatically exit once it has processed 10 messages,
    // exceeded 128M of memory, been running for 30s or received a stop signal via
    // the messenger:stop-workers command.

    // Quit the worker with CONTROL-C.

    // Re-run the command with a -vv option to see logs about consumed messages.

And, as expected from the logs above, no message is being stored in the “messenger_messages” table on the database:

$ sudo -u www-data php bin/console doctrine:query:sql “SELECT COUNT() FROM messenger_messages”
——————
Count (
)
—————–
0
—————–

So of course, no message landing in the queue, no message being sent out!

I tried to run my test campaign again, and it still works, so I wonder what is preventing my production campaign to move forward. What is preventing scheduled messages to land in the doctrine queue?

Is there a limit on the number of messages to be scheduled in a campaign somewhere?
Are 1000 messages too many to be stored in the doctrine queue (I don´t think so)?
Any suggestion?