HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Deleting SPAM without analyzing the words


Our customer care email address receives more than 100 spam emails a day (we’ve been using this email address for 5 years). The Bayes filter is working great with 99% accuracy. We have reached the limit that no more learning is needed for Bayes Spam data.

It takes 10 seconds to delete 5-10 SPAM request in our server. HelpSpot also cannot delete all the requests at once because the thread got killed by the server for running too long.

Please consider adding a new option to turn off SPAM analyzing or new menu “Quick Delete SPAM” in the drop down list in the SPAM screen.

Also , can you please provide a SQL query which I can run to empty SPAM folder?



Hi Minh,

Great to hear that it’s working well. Sounds like you really get a bunch of SPAM!

One of the things we’re working on is a way for the spam filter to only train when it’s needed. That would be when the number of “good” messages analyzed is much different than the “bad” messages analyzed. Currently HelpSpot always analyzes no matter what. Once this is in place it should lower the load a bit, at least when it’s not analyzing. It would be great to get some real world data on this. If you wouldn’t mind it would be very helpful if you could run the query below and post (or email) the results over:
SELECT * FROM HS_Bayesian_MsgCounts

That will show where your message counts are at.

In the meantime, I agree that another way to do this would be good for high email load installations like yours. It’s a bit more complicated than a single query because of the multiple tables involved.

I’m going to work on this over the next day or two and what I’ll do is come up with a script you can add to your HS installation. You can run the script from the command line to delete any spams in the spam queue. By running from the command line you should avoid any trouble with timeouts.

I’ll post the link here when it’s ready.


OK Minh,

The link below is a PHP file which should delete requests marked as spam but will not train them.

To use it you’ll need to remove the .txt extension. You’ll need to edit a few paths inside the file itself. I also wouldn’t recommend using this from your web server directories because you wouldn’t want outsiders running this. If you do need to because you don’t have command line access then make sure to rename it to something nobody will know.


This obviously hasn’t had lots of testing, though I did do some. Backup your database and try it. Then make sure everything seems to be running OK. Also you should probably turn off your mailboxes before you run this so no new mails come in. At least while you’re testing it out.

Pleaset let me know how it works.




These are the numbers:

xCategory iMsgCount
0 201
-1 2751

I will try your script later today. Thanks for your great support.



Thanks Minh, these are very helpful. Looks like you’re running about 10x more spam than regular issues. This will be helpful as we make adjustments to the analyzer in future releases.

Please do let me know how you make out with the script.


The script is working great. Thanks.

Yes, our support email has been in use for few years and we did not (or were not able to) hide it very well. We love Helpspot for this spam filter feature.