Empty mail queue in exim

So you have a lot of mails in the mail queue, from f.e spam accounts?
First check how many mails are in the queue with the command:

# exim -bpc

With me it gives an output of 168 mails, which isn't that much.
If you have a lot of spam mails, it can go over 1000 mails in the queue.

Then you can give in this command to see the sender and receiver of the mails:

# exim -bp | less

I use the "| less" command, because if you have more than 1000 mails, you can check where most are coming from.

Let's say for example there are a lot of mails in there from info@secure-paypal.com.

This is the way to empty all mails from that specific address:

# grep -lr 'info@secure-paypal.com' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm

Now check the mail queue again with the command:

# exim -bpc

You should have less mails than before!

  • 20 Users Found This Useful
Was this answer helpful?

Related Articles

Linux rebuild broken software raid array - CENTOS

With this article I will show you how to look if a raid array (in our case a RAID1 array) is...

Block IP from your server

You can block an IP (12.12.12.12) from your server with the following command:# iptables -I INPUT...

Check port used in linux

If you want to see which process is using which port, you can do it with the following command:#...

SATA drive not recognized in linux

If your SATA drive does not get recognized when installing linux (happens on older linux...

Stuck on Probing PCI hardware

If you are trying to install CentOS 4.6 and it hangs on "Probing PCI hardware" then you can fix...