Press Ctrl/Cmd + P to print
or save as PDF

HOW TO: Clean Exim Mail

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 <[email protected]> [email protected]

66h 1.2K 1KaRH0-0007QZ-B5 <[email protected]> [email protected]

9h 22K 1KbLHr-0004ev-An <[email protected]> [email protected]

In the above example, “[email protected]” is the email address the email that the user sends from while “[email protected]” 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!