cPanel includes the
mailperm script that can be used to correct permissions on mail files within an account.
This procedure will only work if the user's files are not owned by root. If the user's mail files are owned by root you will need to follow the instructions in this article:
The usage of the command is:
# /scripts/mailperm --help
Usage: mailperm <modifier> <user>
<user> - Optional argument to specify the scope of
the permissions checks. The specified user must
be a valid system account.
--skiplocaldomains - This optional argument bypasses
addition of missing domains to the /etc/localdomains
file when specified. The localdomains file specifies
to Exim that it should always accept delivery for
the listed domains. Remote domains are removed from
/etc/localdomains regardless of this flag.
--skipmxcheck - This optional argument bypasses synchronizing
the mail exchanger setting from the cpanel users file to the
--dirsonly - This optional flag limits setting permissions
to only modifying directories.
NOTE: The “maildirsize” files are always fixed if needed.
--skipserverperm - This optional flag prevents modification
of the mail system files used by Exim and limits the
scope of permission modifications to the mail account
--verbose - This optional flag signals the utility to
report detected permissions problems per user prior
to modifying any permissions.
--help - display this message and exit.
A typical command would be:
# /scripts/mailperm --verbose testuser
For instructions on using the WHM GUI for this same task, see How to Fix Mailbox Permissions via WHM