20k emails were suddenly sent over the last 24 hours and we can't understand why

Your software
My Mautic version is: 3.3.1
My PHP version is: 7.4
My Database type and version is: Mysql 5.7

Your problem
My problem is:

Bug Description

We enabled email scheduling about 1 week ago.

This is my crontab

0,15,30,45 * * * * /usr/bin/php /home/forge/mautic.domain.com/bin/console mautic:segments:update
5,20,35,50 * * * * /usr/bin/php /home/forge/mautic.domain.com/bin/console mautic:campaigns:update
10,25,40,55 * * * * /usr/bin/php /home/forge/mautic.domain.com/bin/console mautic:campaigns:trigger

*/5 * * * * /usr/bin/php /home/forge/mautic.domain.com/bin/console mautic:emails:send

*/10 * * * * /usr/bin/php /home/forge/mautic.domain.com/bin/console mautic:broadcasts:send

Then, nothing happened. We didn’t schedule any new emails, we didn’t even log in or touch Mautic… nothing weird happened over the last week, then all of a sudden in the last 24 hours we’re getting a ton of old emails that started sending… I think those old emails, still published and still with ‘pending’ (undelivered) emails are now suddenly sending. SendGrid reports we’ve sent 20k emails in the last 24 hours… some of these date back to 2017!

I have no idea why now, why suddenly it started sending in the last 24 hours??

Any help or insight would be appreciated

Unsent emails in the spool or conditional triggers in campaigns that were not met until now or failed previously would be my first guess.

1 Like

Hrmm… good guess but why did it take a week to start sending after I enabled scheduled sending? What condition would have only caused 3 year old emails to be sent as of April 1st 2021? Very weird.

Can I ask you another question @EJL ? When we found out this was happening we didn’t know how to put a stop to it, so we unpublished all those old emails, and unpublished all campaigns too. Then I contacted SendGrid support and ask them to clear the queue on their end. After all that was done we were able to send again… but despite everything being unpublished it continued to send emails and is still sending some as we speak…

How do we put a stop to this? Is there a kill switch? Is there a way to view the spool and clear it?

It can also happen if you schedule a segment email to a future date, and forget to unpublish that segment email. So anyone who lands in the segment will get the email. Even if you scheduled it 3 years ago.

stop all crons
unpublish emails
deactivate campaigns
delete contents of spool located in mautic/var/spool unless you set it in config to spool elsewhere.