Hi Kelvin,
I had problems with the cron as the usage quota for mailbox wasn't being updated. My support ticket with cPanel resulted in the following bash script. You can call it anything you like, but it needs to be saved with a sh extention. Mine is clearmail.sh
Code:
#!/bin/bash
# remove mail from [email protected] email account.
find /home/exampled/mail/exampledomain.com/info/ -type d \( -name cur -o -name new \) -exec find {} -type f -delete \;
# regenerate maildirsize (to update quota)
/scripts/generate_maildirsize --confirm exampled
This worked well when tested, and the usage quota of mailbox would be updated to zero MB each time.
You would just set a cron job to run this script to the frequency you require.
Hope this helps.