Managing EXIM queue

Posted on February 22nd, 2014

Posted By Muktesh Ashdhir | Comments

In the following article we will going to learn  how to manage the Exim mail queue on VPS (Virtual Private Server) or dedicated server via SSH. This will let us to know why sent messages have not successfully delivered yet. EXIM means the MTA (Mail Transfer Agent) that runs on your server and it also controls your email deliveries. There are certain commands you can run over SSH so that you will be able to manage the Exim mail queue.


connect to your root server via SSH.



Run the following command given below to view the current Exim mail queue:


You should get back something that looks like:

8m 13K 1TwJgO-0001q8-E5 <> *** frozen ***

3m 7.6K 1TwJlQ-0006MV-84 <> *** frozen ***

In this case there are 2 messages waiting to try to deliver to, but they are all stuck. This means Exim has an error while trying to deliver the message hence it has frozen it, until the next delivery retry time.



Now take one of the Exim message IDs from the queue than examine it in the Exim mail log to know why the message can’t deliver with the following command:

exigrep -I -l 1TwJlQ-0006MV-84 /var/log/exim_mainlog

This will give you the full transaction of that message ID exposing

2013-01-18 16:46:16 1TwJlQ-0006MV-84 <= H=localhost [] T=”Update on employee contacts” for
2013-01-18 16:46:16 1TwJlQ-0006MV-84 ** R=virtual_user_maildir_overquota: Mailbox quota exceeded
2013-01-18 16:46:16 1TwJlQ-0006MV-84 Completed



Now in this case this message is failing because the server is giving back an error of Mailbox quota exceeded. One can also attempt and forcefully try to re-send the message by using the following command on the message ID:

exim -M 1TwJlQ-0006MV-84

If you wanted to remove the message from the mail queue.

exim -Mrm 1TwJlQ-0006MV-84

It is necessary that one should know how to investigate messages in your Exim mail queue using Exim commands over SSH.

About Muktesh Ashdhir - Muktesh Ashdhir is a B.Com graduate student with economics and currently preparing for the entrance exams for M.B.A