# How to clear exim mail queue

**URL:** <https://linux-tips.com/t/how-to-clear-exim-mail-queue/137>\
**Category:** Services\
**Created:** [August 3, 2015, 12:00pm UTC](https://linux-tips.com/t/how-to-clear-exim-mail-queue/137 "2015-08-03T12:00:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [August 3, 2015, 12:00pm UTC](https://linux-tips.com/t/how-to-clear-exim-mail-queue/137/1 "2015-08-03T12:00:20Z")

</div>

Sometimes it is necessary to remove all frozen messages in exim mail queue immediately. To do this just use:

```
exim -bpu | grep frozen | awk {'print $3'} | xargs exim -Mrm

```

command. You can also use specific exiqgrep command for this:

```
exiqgrep -z -i | xargs exim -Mrm

```

See also: `man exiqgrep`

If you want to remove some specific emails from the mail queue, you have to get related message ids first with:

```
exim -bp

```

When you know the message id, you can remove it from the queue:

```
exim -Mrm <message-id>
```
