How to delete locked mails from mail queue (Exim)?

Deleting locked emails from Exim mail queue..

Yeah its something different from normal deletion of mails from exim mail queue. Here I’m explaining how to remove locked emails from queue.

While clearing the mail queue for a reason, I got an error like this “Message 1AdTsr-0089tc-F6 is locked” This happens because the mail id ’1PN63s-0005r4-Oh’ is being processed by an exim process.

As such it is required to first kill the corresponding exim process and then removing the mail from mail queue.

So first kill that process corresponding with the Message ID them remove the mail from exim mail queue.

Please do follow the commands pasted below:


[root@EcLinux]# ps aux|grep 'message ID'

[root@EcLinux]# kill -9 'pid'

[root@EcLinux]# exim -Mrm 'message ID'

In this case message ID is 1AdTsr-0089tc-F6 So commands comes like:

[root@EcLinux]# ps aux|grep 1AdTsr-0089tc-F6

[root@EcLinux]# kill -9 'pid'

[root@EcLinux]# exim -Mrm 1AdTsr-0089tc-F6

Alternate method

Stop the exim service and remove all locked mails from queue.

[root@EcLinux]# /etc/rc.d/init.d/exim stop

Delete the message in your Mail Queue

[root@EcLinux]# /etc/rc.d/init.d/exim start

Thats it… 🙂

Also read…

1, Quick way to remove all frozen emails from mail queue Exim
2, How do I enable extended logging in Exim via CLI?
3, How to check spamming on server which has Exim MTA?

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

One thought on “How to delete locked mails from mail queue (Exim)?

Leave a Reply

Your email address will not be published. Required fields are marked *