[TriLUG] Spamassassin question - Bayesian filtering

Jon Carnes jonc at nc.rr.com
Thu Mar 13 13:55:46 EST 2003


Installing SpamAssassin
-----------------------

The easiest way to do this is using CPAN.pm, like so:

        perl -MCPAN -e shell                    [as root]
        o conf prerequisites_policy ask
        install Mail::SpamAssassin
        install Net::DNS
        quit

Created non-spam test message: test_msg.nospam.txt
Created spam test message: test_msg.spam.txt

Tested SpamAssassin:
  spamassassin -t <test_msg.nospam.txt >test_nospam.out.txt
    Success - the message registered a spam level of 0.0

  spamassassin -t <test_msg.spam.txt >test_spam.out.txt
    Success - the message registered a spam level of 17.5

===

In order to run SpamAssassin site-wide,
  http://spamassassin.org/sitewide.html

  create a /etc/procmailrc file and put the following inside:
    DROPPRIVS=yes

    :0fw
    * < 256000
    | spamc

The script sends mail through a filter called "spamc".  This filter
is actually a program that sends the mail off to the SpamAssassin
daemon called "spamd".  For "spamc" to work, "spamd" has to be up
and running as a daemon.

Now we have to make sure that the daemon "spamd" is running
and started each time that the server is started.  We will
use the startup script that comes with the install of SpamAssassin

  cp
/home/jonc/.cpan/build/Mail-SpamAssassin-2.50/spamd/redhat-rc-script.sh
/etc/rc.d/init.d/spamd

Test the startup of the daemon:
  /etc/rc.d/init.d/spamd start

  ps aux |grep spamd
    root      8560 20.0  6.7 16912 15176 ?       S    13:21   0:00
/usr/bin/spamd -d -c -a

Now set the Run Control's to startup "spamd" whenever the server starts:
  ln -s /etc/rc.d/init.d/spamd /etc/rc.d/rc3.d/S96spamd
  ln -s /etc/rc.d/init.d/spamd /etc/rc.d/rc5.d/S96spamd

===

Running spamd takes up ~7% of your available RAM
 8560 root      21   0 15176  14M  1876 S     0.0  6.7   0:00 spamd

<If you want to stop SpamAssassin, be sure to remove the /etc/procmailrc
file first!>
  cp /etc/procmailrc /etc/bak.procmailrc

Testing:
  echo Hello Mate |mail -s "test of spamd" jonc
  cd /var/spool/mail
  cat jonc
    From root  Thu Mar 13 13:31:57 2003
    Return-Path: <root at tt.nt.com>
    Received: (from root at localhost)
        by tigertech.netmar.com (8.11.6/8.11.6) id h2DIVu908579
        for jonc; Thu, 13 Mar 2003 13:31:57 -0500
    Date: Thu, 13 Mar 2003 13:31:57 -0500
    From: root <root at tt.nt.com>
    Message-Id: <200303131831.h2DIVu908579 at tt.nt.com>
    To: jonc at tt.nt.com
    Subject: test of spamd
    X-Spam-Status: No, hits=0.0 required=5.0
        tests=none
        version=2.50
    X-Spam-Level:
    X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp)

    Hello Mate

Success!

======

I just did this for a client and the above instructions are from the
SpamAssassin section.

HtH - Jon Carnes

===
On Thu, 2003-03-13 at 13:45, Turnpike Man wrote:
> Jeremy,
> 
> I'd love to get some hands on just getting started with Spamassassin!!  I've
> been running sendmail for over a year now at home for my xyz.net domain and I
> don't really use it for anything on a daily basis, hardly even close friends
> b/c I don't wanna have tons of spam... which is inevitible once you start using
> a certain email address.  I setup my roommate with an email account, he uses it
> often, but I don't use it yet. (thus still my yahoo account)  Not being an
> expert in RTFM (I learn better by show and tell)... where does one get a start!
>  I'd like to be able to use sendmail in production at my place of work one day
> too, and without something like Spamassassin, that would be hard, we get so
> much junk on our generic accounts like info, webmaster, recruiter, etc.  I'll
> be at the meeting tonite, hopefully to formalize my membership into TriLUG. 
> See ya there.
> 
> David
> 
> 
> --- Jeremy Portzer <jeremyp at pobox.com> wrote:
> > Good afternoon folks,
> > 
> > I've been playing around with the new Spamassassin, version 2.50, which
> > includes Bayesian filtering (see http://www.paulgraham.com/spam.html for
> > the paper about this, mentioned at ESR's talk, and see the man page for
> > the "sa-learn" command).
> >
> <<snip>>
> > 
> > If anyone else is interested in testing SpamAssassin, it is installed on
> > the TriLUG mail server now.  Just put something like this in your
> > .procmailrc :
> > 
> > :0fw
> > | /usr/bin/spamc
> > 
> > Then your spam will be marked with the X-Spam-Status header, which you
> > can filter on if you like.
> > 
> > Regards,
> > Jeremy
> > 
> > -- 
> > /=====================================================================\
> > | Jeremy Portzer       jeremyp at pobox.com       trilug.org/~jeremy     |
> > | GPG Fingerprint: 712D 77C7 AB2D 2130 989F  E135 6F9F F7BC CC1A 7B92 |
> > \=====================================================================/
> > 
> 
> > ATTACHMENT part 2 application/pgp-signature name=signature.asc
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
> _______________________________________________
> TriLUG mailing list
>     http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>     http://www.trilug.org/~lovelace/faq/TriLUG-faq.html





More information about the TriLUG mailing list