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.

STEP 1.

connect to your root server via SSH.

 

STEP 2.

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

     exim-bp

You should get back something that looks like:

8m 13K 1TwJgO-0001q8-E5 <sender@example.com> *** frozen ***
me@example.com

3m 7.6K 1TwJlQ-0006MV-84 <sender@example.com> *** frozen ***
user@example.com

In this case there are 2 messages waiting to try to deliver to Me@example.com, 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.

 

STEP 3.

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 <= sender@example.com H=localhost [127.0.0.1] T=”Update on employee contacts” for me@example.com
2013-01-18 16:46:16 1TwJlQ-0006MV-84 ** me@example.com R=virtual_user_maildir_overquota: Mailbox quota exceeded
2013-01-18 16:46:16 1TwJlQ-0006MV-84 Completed

 

STEP 4

Now in this case this message is failing because the me@example.com 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