So your using cPanel and you’ve got a ton of spam sitting in it using up valuable server resources, you’ve Googled the problem and found out how to disable the catch all address but still it’s showing that the mail exists and is wasting space.
For those looking to turn off the catch all address first, this is how you do it in cPanel:
First log in, then click on the ‘Default Address’ icon:
You will then be presented with a list of option, you need to change the radio from ‘Forward to email address’ to ‘Discard with error to senter (at SMTP time)’:
This will then reply to all e-mails sent to addresses which have not been set up (all catch all addresses *@domain.com), the message sent can be specificied on that page but if not it will simply send ‘No such person at this address’.
As you can see, you can also discard the message totally (no reply to sender) but keep in mind if someone sends a genuine email they will not be aware they mistyped your e-mail address and thus assume . The other option is to pipe all e-mails, this is commonly used in scripts like help desks (PHP, Pearl).
Disabling catch all by default for new cPanel accounts in WHM:
If you are running WHM on your server and want to have catch all disabled by default then it’s simply, log into WHM and go to ‘Tweak Settings’:

Then scroll down to ‘Mail’ and change the setting from ‘Local’ to ‘Fail’:
Save the settings and then all new accounts will have catch all disabled.
Removing existing emails.
So now you won’t receive any more, you still need to get rid of the existing mail which could be taking up copious ammounts of space, for this you may require assistance from your web host depending on how they have everything set up because you will need to delete some files outside of your web root.
If it’s your server the path should be ‘/home/user/mail/’ if it’s not and you just have a cPanel account then you should just see ‘/mail/’.
Within the mail directory you will see three folders, cur, new and tmp:
You need to delete the ‘cur’ directory and then recreate it (basically, your deleting the contents of the folder), you then still have a cur folder with absolutely no contents.
That’s it, that’s everything!
Note: In cPanel you might still see the usage for the catch all account still takes room, well that’s not strictly true, the server simply needs to update which it will do but be rest assured the space is not actually being taken up.
As you can see in the image, there is a note stating that space usage is recalculated every few hours.
You can force an update, but I wouldn’t bother, just let cPanel do it, it’s safer.
You must be logged in to post a comment.
Just to add something I forgot.
If your logged into your server under a root account when performing these actions, it will save the group and owner as root which is turn prevents the user from seeing their e-mail, they maybe able to see how much they have but they won’t be able to see what, who from, read or reply because their permissions are wrong for that folder.
So if your logged in as root don’t forget to change the group and owner back to it’s correct cPanel user (In other words the username for the cPanel owner, not the e-mail username).