cPanelResources

Tutorial How To Train SpamAssassin with SA-Learn

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
@km9

You would just add the line with a ! in front to the /etc/cagefs/cagefs.mp file.

Code:
[07:47:42 sin09 [email protected] ~]cPs# grep '/var/cpanel/locale' /etc/cagefs/cagefs.mp
!/var/cpanel/locale
Please let me know if this helps!
Yes, thanks. I was getting confused with the instructions here:


"Any directory from the server that needs to be shared across all users is mounted into /usr/share/cagefs-skeleton (a list of such directories is defined in /etc/cagefs/cagefs.mp)"
 

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
@km9 The /var/cpanel/locale directory needs to be added to cagefs.mp so it can be shared properly across users. This is a directory that multiple users will need to make use of. Can you elaborate on which part you're having issues with exactly?
Thank you, no, that's fine. I was just confused by the language in the Cloudlinux documentation. It made me think there was more to it than just adding a line in the cagefs.mp file. Thanks for your assistance. This problem appears to have been completely solved now.
 
  • Like
Reactions: cPanelAnthony

[D_A]

Registered
Jan 18, 2022
3
0
1
On Earth
cPanel Access Level
Root Administrator
So this instruction/script is for Maildir format... Any scripts for sa-learn for mdbox format emails?
(I mean, if mdbox email user wants to utilize sa-learn under his/her cpanel account (not server wide but under user account))
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,045
111
118
Houston, TX
cPanel Access Level
Root Administrator
So this instruction/script is for Maildir format... Any scripts for sa-learn for mdbox format emails?
(I mean, if mdbox email user wants to utilize sa-learn under his/her cpanel account (not server wide but under user account))
While there wouldn't be any supported alternative to sa-learn for mdbox, the following article might be helpful.

 

[D_A]

Registered
Jan 18, 2022
3
0
1
On Earth
cPanel Access Level
Root Administrator
While there wouldn't be any supported alternative to sa-learn for mdbox, the following article might be helpful.

But as for info on:
And possible script from:
(However that script relies on using bayes DB? Any suggestions or scripts You can provide on that? Because cPanel users/server owners are not all using maildir format and it would be great to have functional script also from cPanel's side for mdbox mails ...)
 

mydigia

Member
May 30, 2020
6
0
1
UK
cPanel Access Level
Root Administrator
This tutorial is great for someone who's hands on and admins the server and has the time to sit and tailor and as mentioned train SA to deal with spam, but I think what's fundamentally being missed by cPanel is the practicality of the whole issue.

As a hosting provider for 14 years, I know too well that most our users are businesses that have no time or desire to sit and listen to why something was flagged or wasn't flagged as SPAM as it should have, and as much as we explain that all such systems (even Google & MS365) have false positive, the 'expectation' for an admin to sit and use sa-learn so that spams can be caught and hams let through is just not practical.

As an admin, I want all that headache taken away from the customer and things to be much more practical.

What happened to "Mark As Not Spam" triggering sa-learn on particular email? So when a user opens a call with us about I didn't get that email, we reply, if you monitor and find it on our Junk folder, Mark As Not Spam (move from .Junk to Cur) and that should automatically trigger training SA.

As hosting providers, we're competing with the likes of Google Workspace/Microsoft 365 emails, and the expectation to sit and run commands in today's world is just not practical in my opinion.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,032
1,741
363
cPanel Access Level
Root Administrator
What happened to "Mark As Not Spam" triggering sa-learn on particular email? So when a user opens a call with us about I didn't get that email, we reply, if you monitor and find it on our Junk folder, Mark As Not Spam (move from .Junk to Cur) and that should automatically trigger training SA.
We're actually adding this feature to Roundcube in version 104! You can see this in the change log at 104 Change Log | cPanel & WHM Documentation under the following entry:

Fixed case CPANEL-40670: Update cpanel-roundcubemail to 1.5.2.1-3.cp11102.
 

mydigia

Member
May 30, 2020
6
0
1
UK
cPanel Access Level
Root Administrator
We're actually adding this feature to Roundcube in version 104! You can see this in the change log at 104 Change Log | cPanel & WHM Documentation under the following entry:

Fixed case CPANEL-40670: Update cpanel-roundcubemail to 1.5.2.1-3.cp11102.
Thanks for your reply.

Yes I'm aware and checked, however it seems to have been added to Roundcube which in my opinion completely misses the point. I've been in hosting for 14 years, and I can say 80~90% of users are on Email clients one way or another, the trigger for sa-learn should be on message moving to/from Spam folder, regardless of it being from Roundcube or not.
i.e. Even if the user clicks on their Outlook as Not Junk (assuming on IMAP), they should still in effect be training their spam filter.
Currently, I'm having to tell those users: 1. Please wait for 104 to be stable to be adopted by us and 2. Once it is available, you will need to login to Webmail and use Roundcube to 'train' your spam filter. #not_practical in my opinion... (SpamAssassin Bayes training via Cpanel)
 

mydigia

Member
May 30, 2020
6
0
1
UK
cPanel Access Level
Root Administrator

LotusBlossom

Member
Dec 20, 2019
8
2
3
California
cPanel Access Level
Root Administrator
@km9

You would just add the line with a ! in front to the /etc/cagefs/cagefs.mp file.

Code:
[07:47:42 sin09 [email protected] ~]cPs# grep '/var/cpanel/locale' /etc/cagefs/cagefs.mp
!/var/cpanel/locale
Please let me know if this helps!
This helped thank you!

For anyone else coming across this same problem, after you have added the "!/var/cpanel/locale" line to "/etc/cagefs/cagefs.mp", be sure to then run the command "cagefsctl --remount-all" in terminal, this will make CageFS use the updated cagefs.mp file.
 
  • Like
Reactions: cPRex