Apache SpamAssassin global enable anyone?

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
Hey Mikalo,

I'm not sure which files are important and which are not.

My /usr/share/spamassassin folder has 48 files...most are less than 40K and only one about 100K, so it's not using much space.

Not certain why you removed them.

 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
I'm not a SpamAssassin expert, but since no-one else has answered ...

The /etc/mail/spamassassin directory is for per-system config, as far as I can see. Thus files that get dropped in there just run.

The /usr/share/spamassassin directory is for the internal configuration of spamassassin. I suspect the files refer to each other, or are referenced from a single point. If you've gone in there and deleted files, I suspect you'll need to restore every single file to get it to work again. Hopefully you had backups!

The two directories are completely different, having nothing to do with each other, you can't just combine them on some random guess that it will be "easier to administer". Unfortunately your guess turned out to be wrong wrong! Always, always, if you have to fiddle, keep an online backup of what you've changed - in this case, a backup of the directory, or move the files somewhere rather than removing them. And in general unless you understand a subsystem well, don't fiddle. A modern webhosting system contains a lot of subsystems all of which are really complex and you just can't be expert in all of them.
 

carlaron

Well-Known Member
Jun 26, 2003
45
0
156
It turns out that my SpamAssassin (3.1.7) is configured for the entire server.
So, all I need to do is add the file .spamassassinenable to each /home/<user> directory
All of the earlier examples in this thread copied the .spamassassin folder... will that folder be created for each client automatically, then, once the .spamassassinenable file is in their home directory?

And where do I find any global settings for spamassassin? Is there a way to make spamassassin do a basic filtering before any Forwards take place, regardless of whether the individual client has spamassassin on?

I have many clients Forwarding to AOL and Comcast. Even when spam assassin is on, and an Email Filter to toss all "Spam Header begins Yes" mail is in place, the Forwarded mail seems to go through un-filtered, causing AOL and Comcast to blacklist me as if I were an open relay.:mad:

I guess I want to cut out the worst of the spam before it even gets to the level where individual clients can adjust their settings.
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
carlaron,

Yes that folder gets created 'automagically' once SA is enabled (i.e. via cPanel which places the .spamassassinenable file in /home/<urser> or by manually copying the file there via a script)

brianoz (above) answered your question regarding global settings.

By the way, my email forwards are getting filtered by SA before they are forwarded...which is a good thing.
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
That is weird!

After running spamassassin -D --lint

The last few lines are:

Code:
[26719] dbg: plugin: Mail::SpamAssassin::Plugin::ReplaceTags=HASH(0xb20fad0) imp
lements 'finish_parsing_end'
[26719] dbg: replacetags: replacing tags
[26719] dbg: replacetags: done replacing tags
[26719] dbg: bayes: DB_File module not installed, cannot use bayes
[26719] dbg: config: score set 0 chosen.
[26719] dbg: message: ---- MIME PARSER START ----
[26719] dbg: message: main message type: text/plain
[26719] dbg: message: parsing normal part
[26719] dbg: message: added part, type: text/plain
[26719] dbg: message: ---- MIME PARSER END ----
[26719] dbg: bayes: DB_File module not installed, cannot use bayes
[26719] dbg: dns: is DNS available? 0
[26719] dbg: metadata: X-Spam-Relays-Trusted:
[26719] dbg: metadata: X-Spam-Relays-Untrusted:
[26719] dbg: metadata: X-Spam-Relays-Internal:
[26719] dbg: metadata: X-Spam-Relays-External:
[26719] dbg: message: no encoding detected
[26719] dbg: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0xa2418a8) implem
ents 'parsed_metadata'
[26719] dbg: rules: local tests only, ignoring RBL eval
[26719] dbg: check: running tests for priority: 0
[26719] dbg: rules: running header regexp tests; score so far=0
[26719] dbg: rules: ran header rule __HAS_MSGID ======> got hit: "<"
[26719] dbg: rules: ran header rule __SANE_MSGID ======> got hit: "<[email protected]
int_rules>
[26719] dbg: rules: "
[26719] dbg: rules: ran header rule __MSGID_OK_HOST ======> got hit: "@lint_rule
s>"
[26719] dbg: rules: ran header rule __MSGID_OK_DIGITS ======> got hit: "11664749
41"
[26719] dbg: eval: all '*From' addrs: [email protected]
[26719] dbg: eval: all '*To' addrs:
[26719] dbg: rules: ran eval rule NO_RELAYS ======> got hit
[26719] dbg: rules: ran eval rule __UNUSABLE_MSGID ======> got hit
[26719] dbg: rules: running body-text per-line regexp tests; score so far=-0.001
[26719] dbg: rules: ran body rule __NONEMPTY_BODY ======> got hit: "I"
[26719] dbg: uri: running uri tests; score so far=-0.001
[26719] dbg: bayes: DB_File module not installed, cannot use bayes
[26719] dbg: bayes: not scoring message, returning undef
[26719] dbg: bayes: opportunistic call attempt failed, DB not readable
[26719] dbg: rules: running raw-body-text per-line regexp tests; score so far=-0
.001
[26719] dbg: rules: running full-text regexp tests; score so far=-0.001
[26719] dbg: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0xa2418a8) implem
ents 'check_tick'
[26719] dbg: check: running tests for priority: 500
[26719] dbg: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0xa2418a8) implem
ents 'check_post_dnsbl'
[26719] dbg: rules: running meta tests; score so far=-0.001
[26719] info: rules: meta test SARE_RD_SAFE has undefined dependency 'SARE_RD_SA
FE_MKSHRT'
[26719] info: rules: meta test SARE_RD_SAFE has undefined dependency 'SARE_RD_SA
FE_GT'
[26719] info: rules: meta test SARE_RD_SAFE has undefined dependency 'SARE_RD_SA
FE_TINY'
[26719] info: rules: meta test SARE_HEAD_SUBJ_RAND has undefined dependency 'SAR
E_XMAIL_SUSP2'
[26719] info: rules: meta test SARE_HEAD_SUBJ_RAND has undefined dependency 'SAR
E_HEAD_XAUTH_WARN'
[26719] info: rules: meta test SARE_HEAD_SUBJ_RAND has dependency 'X_AUTH_WARN_F
AKED' with a zero score
[26719] dbg: rules: running header regexp tests; score so far=1.866
[26719] dbg: rules: running body-text per-line regexp tests; score so far=1.866
[26719] dbg: uri: running uri tests; score so far=1.866
[26719] dbg: rules: running raw-body-text per-line regexp tests; score so far=1.
866
[26719] dbg: rules: running full-text regexp tests; score so far=1.866
[26719] dbg: check: running tests for priority: 1000
[26719] dbg: rules: running meta tests; score so far=1.866
[26719] dbg: rules: running header regexp tests; score so far=1.866
[26719] dbg: rules: running body-text per-line regexp tests; score so far=1.866
[26719] dbg: uri: running uri tests; score so far=1.866
[26719] dbg: rules: running raw-body-text per-line regexp tests; score so far=1.
866
[26719] dbg: rules: running full-text regexp tests; score so far=1.866
[26719] dbg: check: is spam? score=1.866 required=4.8
[26719] dbg: check: tests=MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,TO_CC_NONE
[26719] dbg: check: subtests=__HAS_MSGID,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__NON
EMPTY_BODY,__SANE_MSGID,__UNUSABLE_MSGID
 

carlaron

Well-Known Member
Jun 26, 2003
45
0
156
That's odd that it works, because I don't see YESBO in the spamassassin documentation, but do find YESNO (see http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html)

Are you getting any errors when you run "spamassassin -D --lint" ?
That definitely needs to be _YESNO_, and not _YESBO_...

I made the changes suggested, and this morning, a ton of spam was getting through... It would arrive in my mailbox with notice saying:

Spam detection software, running on the system "whm.maiatech.com", has
identified this incoming email as possible spam.....etc.....
Content analysis details: (8.3 points, 5.0 required)
But my email filter is set to discard anything that spam assassin considers spam (over 5, for this account)... so this email should never have even made it to the mailbox.

I looked at several, and the X-Spam-Status header began "_YESBO_", whereas looking at mail from before I made the change it was either "Yes" or "No", and my Email Filter is set to look for "Yes" at the beginning of the X-Spam-Status header and discard it.

Changing that to _YESNO_ fixed it, and all the headers now read "Yes" or "No", and on those accounts set to discard "Yes", the spam is not arrving in the mailboxes anymore.
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
carlaron,

That's good news!

Curiously, was yours also initially set to YESBO before reading this post or did you change it to YESBO after reading my post and then fixed it back?
 

carlaron

Well-Known Member
Jun 26, 2003
45
0
156
carlaron,

That's good news!

Curiously, was yours also initially set to YESBO before reading this post or did you change it to YESBO after reading my post and then fixed it back?
Actually, my global settings where blank until I set them following your instructions. I'm not sure of the precedence of global settings versus per-domain settings, but in this case, it followed the global settings.
 

madan.cpanelnet

Well-Known Member
Apr 1, 2006
69
0
156
INDIA
Hello,

The need never arise for me to enable it serverwide... here is how I did?



How would this be?


Enable SpamAssasin Serverwide
##########################
for x in `cut -d: -f2 /etc/trueuserdomains` ; do touch /home/$x/.spamassassinenable ; chown $x.$x /home/$x/.spamassassinenable ; done

Enable SpamBox Serverwide
##########################
for x in `cut -d: -f2 /etc/trueuserdomains` ; do touch /home/$x/.spamassassinboxenable ; chown $x.$x /home/$x/.spamassassinboxenable ; done


Thanks
 

paulmulder

Member
Jun 5, 2004
7
0
151
use whm

Simply upgrade to the latest version of cpanel.

Click on the exim configuration link and check "Turn on SpamAssassin for all accounts (Global ON)."
 

akalyptos

Member
Mar 25, 2006
8
0
151
Yes new version of cpanel have this option.

But i want to Turn on Spam Box too, automatic for all new accounts
 

madan.cpanelnet

Well-Known Member
Apr 1, 2006
69
0
156
INDIA
Enable SpamBox Serverwide
##########################
for x in `cut -d: -f2 /etc/trueuserdomains` ; do touch /home/$x/.spamassassinboxenable ; chown $x.$x /home/$x/.spamassassinboxenable ; done
 

shacker23

Well-Known Member
Feb 20, 2005
263
1
168
auto-delete

I know this is an old thread, but would anyone happen to know how to globally enable spamassassin auto-delete? Perhaps a modification of the script at the start of the thread?

Thanks,
Scot