How to handle spam training in Hestia

Hi. I’m new to Hestia, and new to any control panel. I’m trying Hestia out because I’m getting too old & lazy to roll my own every so many years when updates or system entropy inevitably breaks something. That said, I do like fine grained control and doing things from the terminal, so Hestia seemed like a good pick for me.

Anyways, It’s been almost a decade since I set up my last email server (it was a good run) so I’m kind of rusty and also not yet totally up to speed on Hestia conventions. Is there a prefered method to train a new mail system? So far Hestia is filtering about 50% of spam (and 0 false positives so far) but there hasn’t been a whole lot of traffic to test with yet. I have a pretty massive library of ham and spam from my old server, but I’m not sure if the headers are all in the same format, nor if I need to train that way at all. On my last system I set up an auto created folder along with spam-learn called spam-unlearn for users to place messages that were falsely flagged. I don’t see anything like that by default in Hestia.

TL;DR I’m just really just wondering if I should do anything proactive to train my mail server or if it should just improve over time with self-training? Any tips would be appreciated!

Hi @Plutopotamus,

We’re in the same boat :smiley:

I use this GitHub - sahsanu/v-hestiacp-sieve: Autolearn spam and ham for Hestia CP Spamassassin

It basically adds rules to Dovecot so when the user moves a message to spam folder, it copies to a specified dir /var/mail/imapsieve_copy/spam/ and if the user moves a message from spam dir to another dir, Dovecot copies it to dir /var/mail/imapsieve_copy/ham.

Later, a daily cron job launches a script that will execute sa-learn --spam for messages in /var/mail/imapsieve_copy/spam and sa-learn --ham for messages in /var/mail/imapsieve_copy/ham

For a bit more info:

Keep in mind that Spamassassin won’t use any info learned (Bayes rules) till at least it gets data from 200 messages, so, well, you could use your ham and spam messages to train it and speed up the process. It’s usually better to train Spamassassin with more ham than spam messages.

1 Like

Wow, thank you so much!! That sounds like a perfect solution. I remember now wanting to do something like this with my last mail server and I had some trouble, which is why I did the less elegant solution I mentioned… but this sounds ideal!

Again, thank you so much Sahsanu!!! I am grateful for the detailed reply!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.