How to clean the Exim Mail Server Queue?
To flush the Exim queue, log in to the server using PuTTY and switch to the root user.
After that, type in the following command:
$ exim -qff
or
$ exim -qff -d9 (For more details)
Not Sure How to Show the Exim Mail Queue?
The Exim mail server has a number of command-line options including being able to see what’s currently in the mail queue.
Below shows the command to use in order to view the Exim mail queue.
Command to view the queue:
Please issue this command
mailq
Or
exim -bp
If exim is in /usr/sbin and /usr/sbin is not in your path, you’ll need to prefix the command with the full path like so:
/usr/sbin/exim -bp
Example output:
The output from the above commands will look like this:
3d 1.2K 1Ka6u5-00032Z-Eb <sender@example.com> receiver@example.com
66h 1.2K 1KaRH0-0007QZ-B5 <sender@example.com> receiver@example.com
9h 22K 1KbLHr-0004ev-An <sender@example.com> receiver@example.com
In the above example, “sender@example.com” is the email address the email that the user sends from while “receiver@example.com” is the address the users send to. Often, these would be real email addresses.
For the 3d, 66h, and 9h values, they indicate how long the email message has been in the queue: 3 days, 66 hours, and 9 hours respectively. Moreover, the x.xK values are the message size.
Besides, the 1Ka6u5-00032Z-Eb, etc is the message id and is also the filename of the message on disk. You will find it in /var/spool/exim/msglog and /var/spool/exim/input. However, the directories may vary depending on the Linux/Unix distribution and/or compiled in settings.
Finding the files with the find command
Here is the find command which you can use to locate all the relevant files:
find /var/spool/exim -name "1Ka6u5-00032Z-Eb*"
It will then display something like this after you issued the command:
/var/spool/exim/msglog/1Ka6u5-00032Z-Eb /var/spool/exim/input/1Ka6u5-00032Z-Eb-D /var/spool/exim/input/1Ka6u5-00032Z-Eb-H
Looks like you have learned about how to check and clean the Exim email queue. For more relevant articles regarding the topic of Email, you can visit Knowledge Base anytime.
Happy learning!