How can I re-scan email folders after activating SA Spam Box?

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,336
75
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Hello guys. I just received a domain transfered with hundreds of email accounts used via webmail, it had SpamAssassin Spam Box inactive, and contained LITERALLY THOUSANDS (65k) spam messages in the new/cur folders of EVERY account.
I activated SpamAssassin Spam Box and it is doing a good job moving incoming spam to spam folder, but...

1) How can I re-scan the existing email accounts to move previous spam to the spam folder?
2) How can I schedule an auto-expunge of spam folders task to avoid storing hundreds of megabytes of spam?

Hope you can help.
Thanks!!!
 

cPanelMichael

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

1. There are no native features that will scan email that's already been delivered to the inbox. You may need to search the email through the command line for specific lines of text in the header (e.g. Spam Status) and remove any matches. This third-party URL may help:

http://unix.stackexchange.com/questions/84852/delete-files-matching-pattern

2. You can enable the "Auto Delete SPAM" option via "cPanel >> Apache SpamAssassion".

Thank you.