• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Spamassasin ham vs spam folder

JeffreyZ

Basic Pleskian
Not sure why Plesk no longer has a spam training tab within the panel. That was helpful. How is it done now? From what I see you need to create a spam folder and a ham folder. According to Spamassasin you need to train 200 ham and 200 spam before it will work well. And it seems the only way to train HAM is to create a ham folder. That would mean my client's would need to have a ham folder (assuming they use IMAP) and would have to take emails from their inbox and drop them in that folder. Is that the only way to do it now?!

From the spamassasin website -- I don't understand this:

To train Spamassassin, you get a mailbox full of messages that you know are spam and use the sa-learn program to pull out the tokens and remember them for later:

  • sa-learn --showdots --mbox --spam spam-file
Then you get a mailbox full of messages you're sure are ham and teach Bayes about those:
  • sa-learn --showdots --mbox --ham ham-file
It is important to do both.
 
I am also wondering this. I see that in webmail there is a spam folder which you can drag spam mail into and presumably a corresponding cron which runs sa-learn on the spam folder. However, for SA to work it should have both ham and spam. There appears to be a mechanism for displaying reporting tools within webmail but this seems to apply to older versions of Plesk ...http://www.bigsoft.co.uk/blog/index.php/2007/08/30/horde_spamassassin_imap_plesk_user_confi. Adding the reporting tools in /usr/share/psa-horde/imp/config/conf.php doesnt make them appear in webmail
 
In the admin guide it is suggesting manual configuration of spam and ham directories. This seems counter intuitive for a control panel so i think im missing something? When (in panel) you turn on spam protection for an email address it creates the Spam directory. The admin guide doesnt say whether sa-learn is automatically run on this spam folder?

And the second part of this is that SA needs to have some confirmed ham and again there is no mention of this in admin guide.

So the documentation is no help really
 
Even if you were to create a path to HAM mail on every mailbox, you'd then have to instruct your clients to move mail to that mailbox instead of leaving it in their inbox. That could work but would mean before they delete HAM they instead would move it to the HAM folder. Seems that if you enable spamassasin the HAM folder needs to be created automatically. Does not seem right that we would need to go to the command line to get spamassasin working properly. Would be nice to see an improvement to this for the next release of Plesk. Would be nice to know if anyone has had success with using a HAM folder (i.e. a reduction in spam).

What is the path to spam mail. I cannot find it here:
Maildir]# ls
courierimapkeywords courierimapuiddb cur migration.result tmp
courierimapsubscribed courierpop3dsizelist maildirsize new
 
Last edited:
Well logically, the HAM directory would be the Inbox. Then no need to do anything more although that would be inefficient since the spam training may be run (in a cron) at a point at which the user hadnt moved spam mail to the Spam directory. Even better would be to copy incoming mail to a HAM directory and then users could routinely check the HAM directory and move uncaught spam to the SPAM directory. Its possible this function would be hackable by someone who knew how.

try ls -la and you will see if the .Spam directory exists.
 
Thanks Ashley. I did find the folder.

However I got an error when running the command. Igor?? I assume I run this when in the spam folder, not the directory above...

.Spam]# for message in * ; do /usr/local/psa/admin/sbin/spammng --bayes --mailname=[email protected] --spam=$message ; done
Usage: spammng [options]

spammng: error: no such option: --bayes
Usage: spammng [options]

spammng: error: no such option: --bayes
Usage: spammng [options]

spammng: error: no such option: --bayes
Usage: spammng [options]

spammng: error: no such option: --bayes
Usage: spammng [options]

spammng: error: no such option: --bayes
Usage: spammng [options]

spammng: error: no such option: --bayes
 
/usr/local/psa/admin/sbin/spammng --bayes is indeed not an option - see /usr/local/psa/admin/sbin/spammng --help for options. i think the documentation is wrong
 
I have not been able to manage step one: create a HAM folder. From what I read this has to be in INBOX and if I create a folder in Horde it is not part of INBOX. If I try to do this via SSH I then do not see it in Horde. So I'm at a loss.

Within Maildir I found a folder courierimaphieracl which I thought perhaps was the correct one. However, adding a folder HAM in that folder did not show in Horde. How do I add a folder to the Horde INBOX. "Folder actions" in Horde seems to create the folder elsewhere.
 

Attachments

  • folder actions.png
    folder actions.png
    10.1 KB · Views: 4
Back
Top