Spamd/Spamc configuration with latest version

Discussion in 'Installation/Configuration' started by Fruchtzwerg, Jan 10, 2008.

  1. Fruchtzwerg

    Fruchtzwerg New Member


    I have read various posts about spamd/spamc with ispconfig, but there are some users with problems and it is not clear what to change. In one post its written ispconfig would support spamd/spamc now. Does anyone have a tutorial to enable this functionality or is it detected automatically by ispconfig?

    Best regards
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is writing only the nescessary per user configuration for spamd. Aditionally, you will have to install spamd from your linux distribution and the switch from spamassassin to the spamd binary of your linux distribution in /root/ispconfig/isp/conf/spamassassin.rc.master. All new ot updated users will use spamd then.
  3. timbe

    timbe New Member

    So all one would do to switch is open up


    and change

    | /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin --prefs-file={PREFS_FILE}


    | /usr/sbin/spamd --prefs-file={PREFS_FILE}

    and resave all the user's preferences

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, nearly :) The spamd program does not understand the --prefs-file switch, so you have to change from:

    | /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin --prefs-file={PREFS_FILE}


    | /usr/sbin/spamd

    Spamd should find the prefs file automatically in the homedir of the user. The current ISPConfig releases create a symlink for that.
  5. timbe

    timbe New Member

    Since I have done this, Spam is being filtered but does not include the ruleset that I have downloaded (via rules_du_jour) which worked perfectly before

    sa-learn + rules_ju_jour = kicked butt on our server

    also is there an easy way to setup a mailbox to send to have spamassassin learn?

    Thanks for your time
  6. timbe

    timbe New Member

    Any thoughts?
  7. jbravo

    jbravo New Member

    Are these different from rules located in
    These rules are being automatically used by spamd.

    Personally i use different way - mod ispconfig to move spam into Spam maildir or move there spam with imap client and create cron job to sa-learn from this folder (for every user you want to do it).
    Then spamd will use bayes db for every user you'll enable this. Note that you should learn at least about 200 messages of every type (ham & spam) to start bayes working.
  8. timbe

    timbe New Member

    I guess the question I am asking is.

    Before spamc/spamd My custom rules where in.


    now after the simple switch. I feel like my rules are ignored.

    I have the same rules in


    symlinked to


    and also symlinked to


    It feels like the filtering is back to stock and my custom rulesets are "ignored"

  9. jbravo

    jbravo New Member

  10. stpe

    stpe New Member HowtoForge Supporter

    I have upgrade to ispconfig 2.2.21 on Debian and enabled spamd
    now my spamassassin is not working any longer.
    What is the different between use spamd or spamc in spamassassin.rc?
    Not all user have got the symlink to user_prefs file ?
    Please help:confused:

    # /etc/default/spamassassin
    # Duncan Findlay
    # WARNING: please read README.spamd before using.
    # There may be security risks.
    # Change to one to enable spamd
    # Options
    # See man spamd for possible options. The -d option is automatically added.
    # SpamAssassin uses a preforking model, so be careful! You need to
    # make sure --max-children is not set to anything higher than 5,
    # unless you know what you're doing.
    OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
    # Pid file
    # Where should spamd write its PID to file? If you use the -u or
    # --username option above, this needs to be writable by that user.
    # Otherwise, the init script will not be able to shut spamd down.
    # Set nice level of spamd
    #NICE="--nicelevel 15"
    # SpamAssassin sample procmailrc
    # Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
    # if you use the spamc/spamd combination)
    # The condition line ensures that only messages smaller than 250 kB
    # (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
    # isn't bigger than a few k and working with big messages can bring
    # SpamAssassin to its knees.
    * < 256000
    | /usr/sbin/spamc
    # | /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin --prefs-file={PREFS_FILE}
    # Mails with a score of 15 or higher are almost certainly spam (with 0.05%
    # false positives according to rules/STATISTICS.txt). Let's put them in a
    # different mbox. (This one is optional.)
    * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*
    # All mail tagged as spam (eg. with a score higher than the set threshold)
    # is moved to "/dev/null".
    {SPAM_COMMENT}* ^X-Spam-Status: Yes
    # Work around procmail bug: any output on stderr will cause the "F" in "From"
    # to be dropped.  This will re-add it.
    * ^^rom[ ]
      LOG="*** Dropped F off From_ header! Fixing up. "
      :0 fhw
      | sed -e '1s/^/F/'
    Mar 11 09:17:03 isp01 spamd[1247]: spamd: could not create INET socket on Permission denied 
    Mar 11 09:17:12 isp01 spamd[1286]: spamd: could not create INET socket on Permission denied 
    Mar 11 09:19:22 isp01 spamd[1403]: spamd: could not create INET socket on Permission denied 
    Mar 11 09:20:40 isp01 spamd[1492]: spamd: could not create INET socket on Permission denied 
    Mar 11 09:21:15 isp01 spamd[1561]: spamd: could not create INET socket on Permission denied 
    Mar 11 09:21:16 isp01 spamd[1565]: spamd: could not create INET socket on Permission denied 
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    It looks as if your spamd is not configured correctly or not running. This has nothing to do with ISPConfig.

    Please post the output of:

    netstat -tap
  12. stpe

    stpe New Member HowtoForge Supporter

    Output from netstat

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 *:mysql                 *:*                     LISTEN     9861/mysqld
    tcp        0      0 localhost.localdo:spamd *:*                     LISTEN     22560/
    tcp        0      0 *:81                    *:*                     LISTEN     9034/ispconfig_http
    tcp        0      0 *:1010                  *:*                     LISTEN     3576/perl
    tcp        0      0 vtisp01.pertex.d:domain *:*                     LISTEN     9533/named
    tcp        0      0  *:*                     LISTEN     9533/named
    tcp        0      0 localhost.locald:domain *:*                     LISTEN     9533/named
    tcp        0      0 *:smtp                  *:*                     LISTEN     9316/master
    tcp        0      0 SYN_RECV   -
    tcp        0      0 localhost.localdoma:953 *:*                     LISTEN     9533/named
    tcp        0      0 localhost.localdo:37945 localhost.localdom:1750 TIME_WAIT  -
    tcp        0      0 localhost.localdo:37003 localhost.localdom:1772 TIME_WAIT  -
    tcp        0      0 localhost.localdo:56608 localhost.localdom:1614 TIME_WAIT  -
    tcp6       0      0 *:imaps                 *:*                     LISTEN     2402/couriertcpd
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     2423/couriertcpd
    tcp6       0      0 *:pop3                  *:*                     LISTEN     2407/couriertcpd
    tcp6       0      0 *:imap2                 *:*                     LISTEN     2385/couriertcpd
    tcp6       0      0 *:www                   *:*                     LISTEN     12724/apache2
    tcp6       0      0 *:ftp                   *:*                     LISTEN     8899/proftpd: (acce
    tcp6       0      0 *:ssh                   *:*                     LISTEN     2657/sshd
    tcp6       0      0 ip6-localhost:953       *:*                     LISTEN     9533/named
    tcp6       0      0 *:https                 *:*                     LISTEN     12724/apache2
    tcp6       0      0    0x503fe0b9.hrnxx2.:1688 TIME_WAIT  -
    tcp6       0      0    0x3ef22361.arcnxl.:4431 TIME_WAIT  -
    tcp6       0      0     ::ffff:192.168.1.:51851 ESTABLISHED14775/sshd: root@no
    tcp6       0      0    hd5b9110c.c45-01-1:3396 TIME_WAIT  -
    tcp6       0      0    hd5b9110c.c45-01-1:3397 TIME_WAIT  -
    tcp6       0      0    56347525.rev.stofa:1208 TIME_WAIT  -
    tcp6       0    296     ::ffff:192.168.1.:51804 ESTABLISHED13261/0
    tcp6       0      0     ::ffff:192.168.1.:51049 ESTABLISHED20474/1
  13. gwa7

    gwa7 New Member

    spamc or spamd

    Are we supposed to use:
    | /usr/sbin/spamd
    | /usr/sbin/spamc

    I have seen it both ways. Please explain.
    I appreciate your help!
  14. jbravo

    jbravo New Member

    spamd - daemonized version (service)
    spamc - cmd tool to talk with above and this one You should use.

    I wish i have this mod as a choice (mod to use my system spamd service or ispconfig compilated spamassassin) during ispconfig installation...

Share This Page