How to Manage Default Mail Account in a CPanel Server.

In every CPanel server, we can find a default mail account in the name of the CPanel username. The default mail account is not used for normal mailing purposes. All the notification mails from the server are forwarded to this default mail account.

CPanel also routes mails sent to the non-existing email accounts at your domain name to the default mail account if a catch-all feature is enabled. For example, if your default mail account is admin@yourdomain and someone emails a non-existent or mistakenly entered address, admn@yourdomain, then CPanel forwards the email to admin@yourdomain.

 In most cases, spam mails are sent to randomly generated email accounts that may or may not exists under a domain. CPanel routes these mails to the default mail account. This increases the disk space usage and is often recommended to clear the mailbox of the default mail accounts.

How to clear the mailbox.

The directories responsible for the default mail account disk space usages are ‘new’ and ‘cur’. This directory contains all the read and unread emails in the default mail account. You can find it in the location

/home/username/mail/cur and

/home/username/mail/new

Remove the files in ‘cur’ and ‘new’ to clear the mailbox of the default mail account and also to free the disk space. You can use the remove command to delete the files in ‘cur’ and ‘new’ directories. Double-check the command before deleting the files. Run the below command in your terminal to delete all files in ‘cur’ and ‘new’

$ rm -rf /home/username/mail/cur/*

$ rm -rf /home/username/mail/new/*

The email disk quota in CPanel won’t be changed even after you have removed all the emails from ‘cur’ and ‘new’ directories. This is because the email disk quota is cached in the file maildirsize. You must either remove or rename ‘maildirsize’ file for manually updating the quota. The ‘maildirsize’ file will be created again with the updated mail quota.

$ rm -rf /home/username/mail/maildirsize or use the move command

$ mv /home/username/mail/maildirsize  /home/username/mail/maildirsize.old

You can also use CPanel file manager to perform this operation. To delete the ‘cur’ and ‘new’ directories, just select them and click on delete button. This directory will be recreated by CPanel once you have deleted it. To rename ‘maildirsize’ file select it and click on rename button. You can now enter a new name and save the file.

How to Disable Forwarding to the default Email.

Go to WHM >> Server Configuration >> Tweak Settings >> Mail

Set the value of the field ‘Initial default/catch-all forwarder destination’ to fail

Was this article helpful?

Related Articles

Leave A Comment?