[SLE] Updating to SpamAssassin 2.61 from sources (SuSE 8.2)

From: Carlos E. R. (robin1.listas_at_tiscali.es)
Date: 12/31/03

  • Next message: Peter: "[SLE] USB Modem plug & play?"
    Date: Wed, 31 Dec 2003 21:00:42 +0100 (CET)
    To: SLE <suse-linux-e@suse.com>
    
    

    [report and questions]

    Hi,

    I have just updated to Mail-SpamAssassin-2.61 from sources my SuSE 8.2 -
    previously, I had a look at ftp:.../people/mmj, but there was no rpm for
    8.2; however, the process is very simple:

    Download and expand Mail-SpamAssassin-2.61.tar.bz2. Change to the
    directory, and run 'perl Makefile.PL' (or hit enter on 'mc'), then 'make'

    Using yast, uninstall spamassassin-2.50-12.i586.rpm and
    perl-spamassassin-2.50-12.i586.rpm - but first make a backup copy of files
    '/etc/init.d/spamd' and '/etc/mail/spamassassin/local.cf'

    Then proceed with 'make install', or 'checkinstall' - the second will
    create an rpm, that I don't know if it is fully usable, but anyways, will
    keep the rpm database happy.

    Add options SPAMD_OPTS, SPAMD_AWL and SPAMD_NICE to file
    '/etc/sysconfig/spamd' - I have this:

    # SPAMD_OPTS="..." add these options to the spamd command line
    # (read `man spamd`).
    # SPAMD_AWL=yes Enable the autowhitelist. The same as adding
    # "-a" to SPAMD_OPTS.
    # SPAMD_NICE=<prio> Set the scheduling priority to <prio>; keeps
    # spamd from soaking up your system resources.
    # "yes" is equivalent to "5".

    #SPAMD_ARGS="-d -c -a"

    SPAMD_OPTS="-d -c"
    SPAMD_AWL=yes
    SPAMD_NICE=yes

    Interestingly, you can run the daemon "niced" :-)

    Copy '.../Mail-SpamAssassin-2.61/spamd/suse-rc-script.sh' to
    '/etc/init.d/spamd', and flag it as executable by root. Create a symlink:

    /usr/sbin/rcspamd -> /etc/init.d/spamd*

    Edit '/etc/init.d/spamd' as appropriate comparing it to the original file
    ow which we made a backup. There are some changes, some files that have
    different paths (I think some of it is pre-8.x) - here are the changes:

    Remove line '. /etc/rc.config'

    Comment out lines referencing 'base' and 'link' and the two tests; ie,
    code lines following "# Determine the base..." and "# Force execution
    if..."

    Insert this code instead (substitutes rc.config for >=8.x):

    # Check for existence of needed config file and read it
    #
    # Later, we may want to make startup behavior (user ID, firewalling, ...)
    # configurable, as there are security implications (read README.spamd).
    SPAMD_CONFIG=/etc/sysconfig/spamd
    test -r $SPAMD_CONFIG || exit 6
    . $SPAMD_CONFIG

    In 'function my_getpid()' comment out the last test - this is a hack around
    a bug, about which I wanted to ask here:

      # is that a spamd or what?
    # test $cmd = $SPAMD_BIN || return 11

    With that, test 'rcspamd start', 'rcspamd status' and 'rcspamd stop', and
    we are almost done - I am assuming your setup uses 'spamd' and 'spamc'
    instead of calling directly 'spamassassin':

    cd /etc/init.d/
    chkconfig spamd on
    chkconfig (should respond "on")
    rcspamd start

    And finally, test the mail setup - which I assume was previously working.
    You probably want to edit '/etc/mail/spamassassin/local.cf' with your old
    configurations; I have this:

    rewrite_subject 0
    report_header 1
    use_terse_report 1
    defang_mime 0

    User preferences will not be changed, except that I think the bayes
    database will be modified on the first run.

    Ok, here go my questions. The 'spamd' startup script uses a new code to
    see if the spamd daemon is running, instead of using SuSE's normal code;
    the author explanation is this:

    # Note: The SuSE {start,kill,check}proc utils can't handle perl scripts
    # which change there $0 -- like spamd. So I implemented my own
    # routines which rely on the existence of the pid file.

      # is there any process running at that pid?
      test -d /proc/$pid || return 10

      cmd=`cat /proc/$pid/cmdline 2>/dev/null | cut -d' ' -f1
      test -n "$cmd" || return 1

      # is that a spamd or what?
      test $cmd = $SPAMD_BIN || return 11

    But this code fails. It tries to get the command line associated with the
    daemon PID, reading from '/proc/$PID/cmdline' this:

    /usr/bin/perl-T -w/usr/bin/spamd-d-r/var/run/spamd.pid-d-c-a

    Notice the absence of spaces between the program call and the parameters:
    is that a kernel bug, or a characteristic? The problem is that the output
    of "cut" is "/usr/bin/perl-T", so the comparison to "/usr/bin/spamd"
    fails. My hack was to remove that final test, but then if the daemon died
    previously I might kill an innocent program when closing the service.

    My second question is this; when a mail is detected, the spam mail is
    edited containing:

     a text informing this is spam
     a "Content preview" section
     a "Content analysis detail" section
     the original mail untouched, as a mime attach

    Previously I didn't have a "Content preview", and I don't want it. How do
    I remove it, if possible?

    -- 
    Cheers,
           Carlos Robinson
    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Peter: "[SLE] USB Modem plug & play?"

    Relevant Pages

    • Re: Spam Assassin
      ... >> Anyone got Spamassassin working on Suse 9? ... I run the daemon, and set up ... spamc does not start spamd, ... > Should tell you if a running instance of spamd is present on the system. ...
      (alt.os.linux.suse)
    • Re: Spam Assassin
      ... > Anyone got Spamassassin working on Suse 9? ... I run the daemon, and set up ... Is spamd running? ... Should tell you if a running instance of spamd is present on the system. ...
      (alt.os.linux.suse)
    • Re: calling spamassassin/spamd from xinetd
      ... > run from within xinetd instead of as a free daemon. ... It makes no sense whatsoever to run spamd from inetd. ... The idea of the spamd daemon is that the whole Spamassassin mechanism is ... performance gains. ...
      (comp.os.linux.security)