# Email Queue - Which table is this in the Database? - Need to delete/clear the outstanding queue manually

**URL:** <https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [April 29, 2022, 2:21am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934 "2022-04-29T02:21:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [April 29, 2022, 2:21am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/1 "2022-04-29T02:21:06Z")

</div>

Email Queue - Which table is this in the Database?

- Need to delete/clear the outstanding queue manually

Sending 200k emails and had a warm up on the domain to throttle it - but priorities have changed and need to kill the outstanding

Unable to see anything in the database that screams an obvious table name.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/21f8159bb708f9830382b8ec5d5597792b05b757.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 29, 2022, 5:25am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/2 "2022-04-29T05:25:04Z")

</div>

Its in the file system.  
mautic/var/spool

Each email is a file.

---

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [April 29, 2022, 5:43am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/3 "2022-04-29T05:43:08Z")

</div>

haha yikes okay thats going to be fun cleaning up

Thx mate

---

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [April 29, 2022, 5:50am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/4 "2022-04-29T05:50:58Z")

</div>

@joeyk  
Is there any other references? anything else we gotta be mindful of?

How does the logic work? just run batches from the email send cron?  
Get throttle variable from config - send email - delete file

So in theory we could add to our commands.php file

Count queue

```auto
$queue_count= count(glob("/var/spool/" . "*"));
echo $queue_count;

```

Then Delete

```auto
$queue_files = glob('/var/spool/*'); // get all file names
foreach($queue_files as $queue_file){ // iterate files
  if(is_file($queue_file)) {
    unlink($queue_file); // delete file
  }
}

```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 29, 2022, 6:17am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/5 "2022-04-29T06:17:31Z")

</div>

I would play with the cron execution + batch size.  
Here is a guide:

> [@Matching SES send rate](https://forum.mautic.org/t/matching-ses-send-rate/6783/5):
>
> Hi @ezzat ! There are different ways how to handle SES with Mautic, I will share you my practice, which I use for all our customers at [Friendly Automate](https://friendly.is/automate) and which works like a Swiss clockwork. There are other good solutions as well, I’m sure someone will post their in this thread. (Always use the proper path, since I’m not paying attention to it in this guide) Too fast sending If you send too fast, your campaign will fall into a cliff. That means you start sending, depending on the speed firs…

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 29, 2022, 6:20am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/6 "2022-04-29T06:20:13Z")

</div>

To sum up:  
You want to play with  
How often you run the command that sends emails + how many emails you send.  
If you run your `mautic:emails:send` command every 10 minutes with a batch size of 150:  
**mautic:emails:send --message-limit=150**

Then you will send out 150 emails / 10 min = 900 emails / hour.

---

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [April 29, 2022, 6:29am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/7 "2022-04-29T06:29:46Z")

</div>

But deleting those files to kill off the queue? - all good?

No other considerations?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 29, 2022, 6:39am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/8 "2022-04-29T06:39:59Z")

</div>

Yes it will kill the queue.  
The emails wont be sent out.  
In Mautic you will see as ‘sent’ because this status is added once the email is “baked” and ready to be delivered = added to the queue.  
So if you delete them, it’s the equivalent of the delivery guy ate the pizza. Counts as delivered but you stay hungry.

---

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [April 29, 2022, 6:41am UTC](https://forum.mautic.org/t/email-queue-which-table-is-this-in-the-database-need-to-delete-clear-the-outstanding-queue-manually/23934/9 "2022-04-29T06:41:16Z")

</div>

Haha love the metaphor mate

But yep fully acknowledged  
Cheers mate
