GetCpanelSupport Blog

Truncating Eximstats – Eximstat Database size increasing to large size

Published on : June 30, 2018 by Andy Robert

If you are familiar with cPanel you might know that cPanel uses the famous Exim as MTA. Exim manages the mail queue using Eximstats. Eximstats parses the exim log to produce text and graphical data, i.e. number of sucessful and unsucessful delivery etc etc. From WHM we can analyse the email queue by from “Home » Email » Mail Queue Manager“. The eximstat normally analyse the exim mainlog and syslog files to generate a statistical output.

Scenario

At times there will be issues when you try to clear the mails through WHM due to the eximstats database having large size. Here we will clears the eximstats database from command-line.

Note: You will need SSH and root access to the server to proceed.

How to

  1. Access server

  2. Access MySQL

  3. Switch to the eximstats database

  4. Truncate (empty) the tables

  5. Close MySQL

  6. Check database integrity

  7. Restart exim.

Steps in detail

Access Server

You can access the server as root via ssh. Use PuTTY SSH clietnt or run following command from terminal if you use a linux OS

ssh root@server-ip -p ssh-port

Replace server-ip with your cPanel server IP and port with your SSH port. Default port is 22

Access MySQL

Run “mysql” from command line once you log in. You may get result like below.

mysql

Switch to the eximstats database

Once accessing MySQL you need to switch the database to eximstats database. Run following command to do that.

use eximstats;

You may get result like below.

eximstats

Truncate (empty) the tables

Eximstats database has 3 tables named defers, failures, sends and smtp. What we need to do is remove all the contents from all those tables. To do that you need run command “truncate table table_name”

First we need to list the tables in the database. Run command “show tables;” You will get below result:

truncate

As you can see the tables are listed in the result. Now we can clear those tables.

Run command “truncate table table_name”

The result will be as following.

truncate table

Close MySQL

You can exit from MySQL by running command “exit”

Check database integrity

Now we can check if the database is intact. Just run the command “mysqlcheck -c eximstats”. You will get output like below.

mysql check

Restart exim

Now we can restart exim by running the command “service exim restart”

That’s it, now you should be able to clear the mail queue from WHM interface without any issues.