How to Delete Pending Emails in the Exim Queue Print

  • 0

To delete pending emails in the Exim queue, follow these steps:

1. Check the total count of emails in the queue:

exim -bpc

2. Filter the emails using the exiqgrep command based on your requirements:

Filter all frozen emails:

exim -bp | exiqgrep -z

Filter all unfrozen emails:

exim -bp | exiqgrep -x

Filter by the sender:

exim -bp | exiqgrep -f [email protected]

3. Review the emails you want to delete. The output will display the time in queue, size, Exim message ID, sender, if the email is frozen or not, and the recipient.

4. Delete the selected emails using the following commands. Note that these commands will remove all matching emails from the queue, including legitimate ones. Deleted emails cannot be recovered.

Delete all frozen emails:

exim -bp | exiqgrep -iz | xargs exim -Mrm

Delete all unfrozen emails:

exim -bp | exiqgrep -ix | xargs exim -Mrm

Delete all emails by the sender:

exim -bp | exiqgrep -if [email protected] | xargs exim -Mrm

Make sure to exercise caution when deleting emails from the Exim queue, as this action is irreversible.


Was this answer helpful?

« Back

Send Message