spamd / spamc with ISPc 2.2.21

Discussion in 'Installation/Configuration' started by jancici, Apr 2, 2008.

  1. jancici

    jancici New Member

    because spamassassin is eating all resources of server and server load is more the 10. I am thinking to switch to spamd / spamc solution.

    what do you think? can it help me? I did read few thread here and looks that it is better solution.

    is it better to install distribution spamd/spamc package or to use those from ISPc ??

    my idea is to use those from ISPc.

    they are here:
    Code:
    ls -la /home/admispconfig/ispconfig/tools/spamassassin/usr/bin
    -rwxr-xr-x 1 admispconfig admispconfig  21454 2008-02-27 16:12 sa-compile
    -rwxr-xr-x 1 admispconfig admispconfig  42963 2008-02-27 16:12 sa-learn
    -rwxr-xr-x 1 admispconfig admispconfig  46290 2008-02-27 16:12 sa-update
    -rwxr-xr-x 1 admispconfig admispconfig  27704 2008-02-27 16:12 spamassassin
    -rwxr-xr-x 1 admispconfig admispconfig  80507 2008-02-27 16:12 spamc
    -rwxr-xr-x 1 admispconfig admispconfig 102502 2008-02-27 16:12 spamd
    I am looking into ispconfig/isp/conf/spamassassin.rc.master because I want to change spamassassin to spamc as I did find out this in another thread.
    Code:
    :0fw
    * < 256000
    | {SPAMASSASSIN_PATH} --prefs-file={PREFS_FILE}
    but you can see that there is variable SPAMASSASSIN_PATH

    doing some grep I did find file ispconfig/scripts/lib/classes/ispconfig_procmail.lib.php
    Code:
    if(is_file('/home/admispconfig/ispconfig/tools/spamassassin/usr/local/bin/spamassassin')){
        $spamassassin_path = '/home/admispconfig/ispconfig/tools/spamassassin/usr/local/bin/spamassassin';
      } else {
        $spamassassin_path = '/home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin';
      }
    
      // Variablen zuweisen
      $mod->tpl->assign( array(PREFS_FILE => $web_path."/user/".$user_username."/.user_prefs",
                               SPAM_COMMENT => $spam_comment,
                               SPAMASSASSIN_PATH => $spamassassin_path,
                                                       USERNAME => $user_username));
    OKAY, lets replace spamassassin with spamc
    Code:
    condition
    if(is_file('/home/admispconfig/ispconfig/tools/spamassassin/usr/local/bin/spamc')){
    first line
    $spamassassin_path = '/home/admispconfig/ispconfig/tools/spamassassin/usr/local/bin/spamc';
    second line
    $spamassassin_path = '/home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamc';
    
    BUT question : who is starting that deamon ??
    Code:
    /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamd
    what do you think? is my steps right?
    please how to start spamd which is install by ISPc ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you switch to clamd already? In most cases, the load is caused by clamsacn and not spamasassin.
     
  3. jancici

    jancici New Member

    well, I did disabled antivirus scan for all users already. to be sure I will check that.

    I have done this update in DB
    Code:
    update isp_isp_user set status='u',antivirus=0,user_spamfilter=1;
    yes, user can switch on antivirus scan on web. but this is not hapend often. usualy they have antivirus on their PC.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    touch /home/admispconfig/ispconfig/.run
    to make the backend start rewrite the configuration.
     
  5. jancici

    jancici New Member

    that TOUCH is not helping to me

    so I am starting SPAMD in script rl.local
    Code:
    cat /etc/rc.local
    /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamd -d --max-children=2
    
    exit 0
    I did find out that modification of file
    Code:
    ispconfig/scripts/lib/classes/ispconfig_procmail.lib.php
    is not good idea.

    so I did modified only file
    Code:
    ispconfig/isp/conf/spamassassin.rc.master 
    and this is my change
    Code:
    :0fw
    * < 156000
    # me | {SPAMASSASSIN_PATH} --prefs-file={PREFS_FILE}
    | /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamc
     
  6. vogelor

    vogelor New Member

    install the spamc of the os

    as i know right, ispconfig is NOT using or starting the spamd daemon.
    for me (at debian) this solution works fine:


    1) aptitude install spamassassin (to install the version of my os)

    2) change /root/ispconfig/isp/conf/spamassassin.rc: | /usr/bin/spamc

    3) update isp_isp_user set status='u' where status ) '';

    4) change anything inside one user (to rewrite the files)

    after this, everything works fine
     
  7. daff

    daff New Member

    I have a Debian Etch System .I installed spamassassin with apt-get and enabled it. I changed the path in /root/ispconfig/isp/conf/spamassassin.rc.master (/root/ispconfig/isp/conf/spamassassin.rc doesn't exist on my sys). I also updated the db and changed a usersetting. But I doen't get it running (spams aren't scanned anymore). What's my fault?
     
    Last edited: May 12, 2008
  8. falko

    falko Super Moderator Howtoforge Staff

    Any errors in your logs?

    What's the output of
    Code:
    spamassassin --lint
    ?
     
  9. daff

    daff New Member

    I think I fixed it already. I changed in /root/ispconfig/isp/conf/spamassassin.rc.master
    Code:
    | {SPAMASSASSIN_PATH} --prefs-file={PREFS_FILE}
    to
    Code:
    | /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamc
    I hope what is right.
     
  10. falko

    falko Super Moderator Howtoforge Staff

    You should copy /root/ispconfig/isp/conf/spamassassin.rc.master to /root/ispconfig/isp/conf/customized_templates/spamassassin.rc.master to make sure this template won't be overwritten when you update ISPConfig. :)
     
  11. daff

    daff New Member

    thanks. is done.
     
  12. bolero

    bolero New Member

    Is this only a backup or will ispconfig use any matching template from the custom ones instead of the original?
     
  13. falko

    falko Super Moderator Howtoforge Staff

    ISPConfig will use the custom ones.
     
  14. bolero

    bolero New Member

    Great. Thanks!
     
  15. jonwatson

    jonwatson New Member

    Does this method still use the user's preferences file or should there still be a --prefs-file at the end of the spamc call?

    Thanks
     
  16. daff

    daff New Member

    I have it running here on a machine and the settings from the users are still used by spamassassin.
     
  17. jonwatson

    jonwatson New Member

    Thanks for the information.

    I wonder how this is possible. How does spamassassin know to use the user's pref file if it is not told to on the command?
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Spamassassin looks in its default configuration file location in the home directory of the user and ispconfig is creating a symlink there to the config file.
     
  19. jonwatson

    jonwatson New Member

    Ah - brilliant. Thanks!

    Jon
     

Share This Page