question about removing spam emails

Venomous21

Well-Known Member
Jun 28, 2012
85
0
6
cPanel Access Level
Root Administrator
Hello,

We have an account that has about 100k spam emails in the inbox catch-all account made during whm account creation. It no longer receives emails, however, I'm having trouble deleting all the emails in this folder.

[/home/user/mail/new]# rm -f /home/user/mail/new/*
-bash: /bin/rm: Argument list too long

I've seen several ways suggested on how to remove spam emails when encountering this problem but none of them seem too concrete. What do you recommend and is it possible to delete them from whm/cpanel as root through the web gui? If I delete the 'new' directory as the 'user' account (and not root) then re-create it and chmod/own permissions, would that be better or would I receive the same error? Does this folder require any special permissions that are not seen when running 'ls -al'?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

You could simply delete the entire "new" directory, and then re-create it with the correct permissions/ownership values. Simply make sure those values match exactly the values of the "cur" directory.

Thank you.