Clearing the Exim Mail Queue From Command Line
If the Exim mail queue on your server has accumulated a large number of messages (often from spam or a compromised account), these commands will help you manage it. Root SSH access is required.
View Queue Size
exim -bpc
View Queue Contents
exim -bp | head -50
Delete All Frozen Messages
exiqgrep -z -i | xargs exim -Mrm
Delete All Messages in Queue
exiqgrep -i | xargs exim -Mrm
Delete Messages From a Specific Sender
exiqgrep -f spammer@domain.com -i | xargs exim -Mrm
Important: Before clearing the queue, investigate why it filled up. Check for compromised email accounts (change passwords), hacked PHP scripts (run a malware scan), or misconfigured forms sending to invalid addresses. Clearing the queue without fixing the root cause means it will fill up again.
This is a server administrator task. Shared hosting customers should contact support if they suspect mail queue issues.
