In order to remove all messages from the mail queue on
dedicated server you will need password to access root user on your dedicated server and a
domain name pointing to the
IP address of your server.
Step 1: Login to the SSH as Root Server
Step 2: You will have to stop the mail system as a security measure during a cleanup process. It is suggested that your
mail system is offline during the process. In order to stop the mail system, you should follow the below mentioned procedure.
Enter ‘service exim stop’. This will stop the mail system.
Step3: Now you will execute the following command to clear the files. rm –rf /var /spool / exim / input/*
The command will initiate clearing up process and will take some time in case of a longer queue. Do not wait for the system to display ‘finish’ prompt. Reappearance of the command prompt to enable you to type next command means that the process of clearing is over.
Step 4 : For clearing the database put the following command, ‘mysqladmin drop eximstats;’ click yes for the process to begin.
Step 5: Now you will re-create the data base by entering ‘mysqladmin create eximstats;’ followed by ‘mysql eximstats < /usr/local/cpanel/etc/eximstats_db.sql’ for restructuring database.
Step 6: Finally you will have to restart the mail system by entering ‘service exim restart’ command.
This how you can remove all messages in queue pertaining to your dedicated server.