Koozali.org: home of the SME Server

Spam Filter

bovnet

Spam Filter
« Reply #15 on: July 03, 2006, 03:56:01 PM »
I ve always been happy with assp on sme 6.

Assp whilst very effective and self tuning has recently undergone a leap in development with added features.

Has anyone put it onto sme 7 is it still possible with sme added built in spam features to disble them and just add assp ?

Offline sonoracomm

  • *
  • 208
  • +0/-0
    • http://www.sonoracomm.com
Spam Filter
« Reply #16 on: July 04, 2006, 01:16:12 AM »
I have not installed ASSP on SME 7, however, I'd be very interested in your results.

The only ASSP upgrade I have done recently was on a Windows server.  The upgrade was painless and I've had no trouble with it.  (I will note that on that Windows server, I did have to set a daily scheduled job to restart the ASSP service...it would occasionally die and not restart before...I haven't tested with the new version, I just let it restart every day...never had that problem on Linux)

ASSP works as a proxy to the smtp daemon...it effectively sits in front of the existing services.  Therefore, I doubt you will have any problems with it conflicting, but...  I would make sure the SA spam filter is disabled in the Server-Manager E-Mail panel.

Please keep us informed.  If you'll e-mail me any changes to the howto, I'll be happy to add them.

Thanks,

G

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Spam Filter
« Reply #17 on: July 18, 2006, 03:52:45 PM »
sonoracomm,

to make the Bayesian filter working, you first must create the bayes databases:

# sa-learn --sync --dbpath /var/spool/spamd/.spamassassin -u spamd
# chown spamd.spamd /var/spool/spamd/.spamassassin/bayes_*
# chmod 750 /var/spool/spamd/.spamassassin/bayes_*


You may also want add a note to your Howto, that the Bayesian autolearn feature is active. With default thresholds 0.1 (ham) and 12 (spam).

Offline sonoracomm

  • *
  • 208
  • +0/-0
    • http://www.sonoracomm.com
Spam Filter
« Reply #18 on: July 18, 2006, 04:19:18 PM »
Hi Michael,

Thanks for your input.

I am a little confused by your post.  Before performing your recommended steps, I looked at the location:

Code: [Select]
[root@mail ~]# ll /var/spool/spamd/.spamassassin
total 300
-rw--w-rw-  1 spamd spamd      6 Jul 18 04:40 bayes.mutex
-rw-r-----  1 spamd spamd  24576 Jul 18 04:40 bayes_seen
-rw-r-----  1 spamd spamd 335872 Jul 18 04:40 bayes_toks


Does this indicate that the databases had already been created and are of the correct permissions?

Also, I don't quite understaand your last suggestion.  Are you suggesting that I inform the admins that once the autolearn feature is enabled that the default thresholds are 0.1 and 12?  Are these good settings?  Should I recommend changing them to something else?  How?

Also, after giving some thought to the Bayesian filtering, It seems to me this may not be a really good idea to implement without some easy, automated or semi-automated whitelisting method.  Without an easy method for users to deal with false-positives, they can be show-stoppers.  Does anyone have any suggestions for whitelisting?

Thanks again,

G

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Spam Filter
« Reply #19 on: July 18, 2006, 05:09:11 PM »
sonoracomm,

you find me confused, too.
These are the databases. The permissions/ownership is ok. (spamd can read/write)

Did you a fresh SME7 Final install?
I have updated from RC3 to final. On RC3 the databases were not created and on SME7 Final they were not re-created after I have deleted them. May be they were only created during fresh install.

Autolearn:
I feel, that score 12 for spam is much to high. I have run autolearn with bayes_auto_learn_threshold_spam=4 for years on serveral SME6 servers . To change the thresholds, you need a new template.
I just packaged an RPM that enables site-wide Bayesian Filter, enables blacklist testing and intodruces spamassassin properties BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonspam.
If you want to have a look on it, you can find it here: http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/smeserver-spamassassin-features-0.0.1-0.noarch.rpm

Offline azche24

  • *
  • 163
  • +0/-0
    • http://az-law.de
Spam Filter
« Reply #20 on: July 19, 2006, 12:28:15 PM »
Hi,
Quote from: "mweinber"

I just packaged an RPM that enables site-wide Bayesian Filter, enables blacklist testing and intodruces spamassassin properties BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonspam.
If you want to have a look on it, you can find it here: http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/smeserver-spamassassin-features-0.0.1-0.noarch.rpm


great. Works!

No more fiddling with chown and db-locations!
Alexander Ziemann, Berlin - DE

rich

Spam Filter
« Reply #21 on: July 19, 2006, 02:48:40 PM »
Quote from: "mweinber"

Autolearn:
I feel, that score 12 for spam is much to high. I have run autolearn with bayes_auto_learn_threshold_spam=4 for years on serveral SME6 servers . To change the thresholds, you need a new template.
I just packaged an RPM that enables site-wide Bayesian Filter, enables blacklist testing and intodruces spamassassin properties BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonspam.
If you want to have a look on it, you can find it here: http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/smeserver-spamassassin-features-0.0.1-0.noarch.rpm


I installed your RPM and got the following error:

[root@catpower ~]# rpm -Uvh smeserver-spamassassin-features-0.0.1-0.noarch.rpm
Preparing...                ########################################### [100%]
   1:smeserver-spamassassin-########################################### [100%]
ERROR: configuration specifies 'use_bayes 0', sa-learn disabled
chown: cannot access /var/spool/spamd/bayes_*': No such file or directory
chmod: cannot access /var/spool/spamd/bayes_*': No such file or directory
spamassassin properties:
BayesAutoLearnThresholdNonspam=0.10
BayesAutoLearnThresholdSpam=4.00
UseBayes=1
qpsmtpd properties:
DNSBL=enabled
RHSBL=enabled


In /var/log/spamd/current I see  ",autolearn=no" at the end of each entry.
Any suggestions?

Offline azche24

  • *
  • 163
  • +0/-0
    • http://az-law.de
Spam Filter
« Reply #22 on: July 19, 2006, 04:56:12 PM »
Quote from: "rich"

ERROR: configuration specifies 'use_bayes 0', sa-learn disabled
chown: cannot access /var/spool/spamd/bayes_*': No such file or directory
chmod: cannot access /var/spool/spamd/bayes_*': No such file or directory


Go to shell and into some junkmail directory. Do

Code: [Select]
sa-learn --spam *

once and repeat the installation of the contrib.rpm. That should have created the bayes databases and the install should work.

Or you issue the commands from the shell stated here earlier. This will also create the bayes dbs.

hth
Alexander Ziemann, Berlin - DE

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Spam Filter
« Reply #23 on: July 19, 2006, 06:10:17 PM »
Quote from: "rich"

I installed your RPM and got the following error:


RPM fixed. Thanks for testing and reporting.
New RPM is on its way to the mirror:
http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/smeserver-spamassassin-features-0.0.2-0.noarch.rpm

rich

Spam Filter
« Reply #24 on: July 19, 2006, 11:11:47 PM »
That worked without errors.
I am watching the logs to see the effects . . .

rich

Spam Filter
« Reply #25 on: July 20, 2006, 12:11:45 AM »
Okay, let me see if I get this . . .

spamd clearly spots this as spam and then says "autolearn=spam"
I assume that qmail won't even accept a mail from them next time.
Is that the case?
If not then what is it doing?


@4000000044bea977309dea4c [3377] info: spamd: connection from localhost [127.0.0.1] at port 32796
@4000000044bea9773180dbf4 [3377] info: spamd: checking message <OBVWEA$HZDCD8574774VEW65B866UK1R57O0488@connectusa.com> for qpsmtpd:1005
@4000000044bea97e1510344c [3377] info: spamd: identified spam (21.0/5.0) for qpsmtpd:1005 in 6.5 seconds, 2509 bytes.
@4000000044bea97e1510538c [3377] info: spamd: result: Y 21 - HTML_MESSAGE,MIME_HTML_ONLY,RAZOR2_CF_RANGE_51_100,RAZOR2_CF_RANGE_E4_51_100,RAZOR2_CF_RANGE_E8_51_100,RAZOR2_CHECK,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_NJABL_DUL,UNPARSEABLE_RELAY,URIBL_AB_SURBL,URIBL_JP_SURBL,URIBL_OB_SURBL,URIBL_SBL,URIBL_SC_SURBL scantime=6.5,size=2509,user=qpsmtpd,uid=1005,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=32796,mid=<OBVWEA$HZDCD8574774VEW65B866UK1R57O0488@connectusa.com>,autolearn=spam

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Spam Filter
« Reply #26 on: July 20, 2006, 06:39:59 PM »
Quote from: "rich"

I assume that qmail won't even accept a mail from them next time.
Is that the case?

No.

Quote from: "rich"

If not then what is it doing?

In short: Spamassassin has learned something new about spam (tokens).
It will use this knowledge to score future mails, regardless of the sender.

See: http://wiki.apache.org/spamassassin/BayesInSpamAssassin

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
problem with permissions
« Reply #27 on: July 26, 2006, 03:18:58 PM »
Good Day,

I have attempted to set up Bayes with SpamAssassin using the LearnAsSpam.pl from here. http://www.sonoracomm.com/sonoracomm/pdf/howto_configure_sme7_spamfilter.pdf

When the nightly cron runs I get the following error:

bayes: expire_old_tokens: locker: safe_lock: cannot create lockfile /var/spool/spamd/.spamassassin/bayes.mutex: Permission denied

I have done the following

chmod 777 /var/spool/spamd/.spamassassin/
chown <user> /var/spool/spamd/.spamassassin/

the chown command worked one time with the following run logged in as the user:

-bash-3.00$ sa-learn --spam *

however when the nightly cron ran I was back to the old error message for that user. (this is the only user learning spam on my system.)

When I run: sa-learn --spam *  as Super User everything is happy.

Any Ideas or suggestions??

Thanks for sharing your work on the script and howto

Royce Holdeman

Offline brianr

  • *
  • 990
  • +2/-0
Spam Filter
« Reply #28 on: July 26, 2006, 03:51:52 PM »
Something seems to have changed in sa-learn in version 3.1.3, i have tried the spamassassin mailing lists, but got no real help.

So, I have uploaded a newer version of the LearnAsSpam perl script to my contribs area, it now runs sa-learn as root, not as the user, please let me know if it works for you..it seems to work for me now.

Contribs area:

mirror.contribs.org/smeserver/contribs/bread/mailstats

look for LearnAsSpam.pl dated today (26thJuly), it might take a few hours to sync up.

Ideally you would have reported this as a bug through bugzilla.
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
permissions
« Reply #29 on: July 26, 2006, 04:07:20 PM »
Brian,

Thanks for a quick answer. I was not sure which buglist to go post on as this is really a contrib that grew from a question on the main server forum. I have removed the old version of the script and the cron job associated with it but will not have time to reinstall for a couple of days.

If the new script runs as root, does each user still need shell access??


Thanks for your work  :-)

Royce Holdeman