How to delete locked emails from Exim mail queue

Today i will explain how to remove locked emails from queue. As it is something different from deleting emails within exim mail queue.

At first when I try to delete these messages as normaly we delete, I got an error like below:

“Message 1BcTvr-0023tc-F8 is locked” This happens because the mail id 
’1BN63s-0007r3-uv’ is being processed by an exim process.

It is required to first kill the corresponding exim process and then removing the email from mail queue.

So we will kill that process corresponding with the Message ID then remove the mail from exim mail queue.

ps aux|grep ‘message ID’
kill -9 ‘pid’
exim -Mrm ‘message ID’?

Alternate method

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

/etc/rc.d/init.d/exim stop

Delete the message in your Mail Queue

/etc/rc.d/init.d/exim start

That’s all. Also give your opinion below if you experience any issues or to discuss your ideas and experiences.