Trying to set up server wide Spamassassin bayes learning

DigitalEssence

Well-Known Member
May 21, 2014
50
6
58
cPanel Access Level
Root Administrator
Hi,

I've got Spamassassin enabled but most of my clients don't know how or where to set it up in CPanel or how to tweak the scores so I wanted to enable server wide settings and make it easy for them.

I'm looking in /etc/mail/spamassassin and have edited the local.cf file and changed:

# rewrite_header Subject *****SPAM*****
to

rewrite_header Subject [SPAM]

#use_bayes 1

to

use_bayes 1

and

#bayes_auto_learn 1

to

bayes_auto_learn 1

but emails are still being tagged with ***SPAM*** which I can't see anywhere in this file. I've tried to grep
for ***SPAM*** but it didn't return anything or I used the wrong command (more than likely).

Ultimately I want spamassassin to auto learn and reduce the number of spam mails but I've fallen at the first hurdle int hat the config file I thought was the right one obviously isn't.

Can anyone please advise?

Thank you,

Hedley
 

cPanelMichael

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

In "WHM Home » Service Configuration » Exim Configuration Manager", under the "Filters" tab, you can modify the following options:

SpamAssassin™: Global Subject Rewrite
SpamAssassin™: X-Spam-Subject/Subject header prefix for spam emails


Thank you.
 

DigitalEssence

Well-Known Member
May 21, 2014
50
6
58
cPanel Access Level
Root Administrator
Oh,

I'm using CENTOS 6.5 x86_64 with WHM 11.42.1.

- - - Updated - - -

Oh knob,

I've just found it:

WHM > Home »Service Configuration »Exim Configuration Manager > SpamAssassin™: X-Spam-Subject/Subject header prefix for spam emails

Ok. My next question is why is this setting overwriting the local.cf file and how do I enable spamassassin bayesian learning for all accounts?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
The options from my previous response are available in cPanel version 11.42. It's not OS-dependent. The method you used to enable "bayes_auto_learn" and "use_bayes" globally should work. Let us know if it's not working.

Thanks.
 

DigitalEssence

Well-Known Member
May 21, 2014
50
6
58
cPanel Access Level
Root Administrator
Thanks Michael,

I'd replied to the post without refreshing so hadn't seen your reply. Typically after hours of searching I only found it AFTER posting on the forum.

Can I just ask: I changed the setting in WHM from default to custom and then left the field blank hoping that the setting in the local.cf file would take precedence but test spam mails are now coming with nothing prepended to the subject.

Is it just the "X-Spam-Subject/Subject header prefix for spam emails" that overides the local.cf file or are there other settings?

Thanks and sorry for being so dim. I'm very very new to all this.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
You can disable the "SpamAssassin™: Global Subject Rewrite" option itself if you prefer there to be no subject rewrite. I suggest using Web Host Manager for these options instead of editing the /etc/mail/spamassassin/local.cf file. That being said, it's not possible to modify the other settings you referenced in Web Host Manager. Instead, those values can be edited by directly modifying the local.cf file and then restarting SpamAssassin.

Thank you.