How to : Remove All messages From the Mail Queue Of Exim

Exim is a well-known Mail transfer agent (MTA) which is compatible with similar operating systems to Unix. It’s goal is to become an all-purpose and flexible mailer with a variety of tools for checking the incoming mail. For more details, read the Exim documentation.

exim-mail-queue-messages-removal

In this post, Hostpoco will demonstrate some commands for eliminating every message from your Mail Queue. Follow the steps.

Step 1: Print a summary of items in the queue type the following command:

exim -bp

Step 2: To delete messages in the queue use the following command:

exim -Mrm {message-id}

Step 3:To get rid of all messages in the queue, use the following command:

exim -bp | awk ‘/^ *[0-9]+[mhd]/{print “exim -Mrm ” $3}’ | bash

Step 4:Dallas Marlow. He suggested the following clean command:

exim -bp | exiqgrep -i | xargs exim -Mrm

Step 5:Command to remove emails of perticular domain from mail queue:

exiqgrep -ir email@domain.com | xargs exim -Mrm

That’s it.

Scroll to Top