SpamAssassin does not work: Connection refused

Created:

2017-01-05 18:38:05 UTC

Modified:

2017-08-08 13:13:26 UTC

0

Was this article helpful?


Have more questions?

Submit a request

SpamAssassin does not work: Connection refused

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

  • Following errors can be found in /var/log/maillog :
    # cat /var/log/maillog | grep -i fail | grep -i spam | less
    spamc[32226]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
    spamc[32227]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
    spamc[32155]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
    spamc[32153]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
    spamc[32154]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
    spamc[32226]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
    spamc[32227]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
    spamc[32153]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
    spamc[32155]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
    spamc[32154]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
    spamc[32226]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
    spamc[32227]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
  • 127.0.0.1 IP address assigned to several network interfaces:
    # ifconfig |grep -C 1 127
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
    --
    venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255

Cause

SpamAssassin listens port 783 on 127.0.0.1 IP address on several network interfaces.

Resolution

Reassign SpamAssassin workprocess on server IP address, e.g 203.0.113.2:

  1. For spamd service add the following parameters in /etc/sysconfig/spamassassin :
    # cat /etc/sysconfig/spamassassin
    # Options to spamd
    SPAMDOPTIONS="-i 203.0.113.2 -A 203.0.113.2 --nouser-config --username=popuser --daemonize --helper-home-dir=/var/qmail --virtual-config-dir=/var/qmail/mailnames/%d/%l/.spamassassin --create-prefs --max-children=1 "
  2. For spamc service add the parameter in /etc/mail/spamassassin/spamc.conf :
    # cat /etc/mail/spamassassin/spamc.conf
    -d 203.0.113.2
Have more questions? Submit a request
Please sign in to leave a comment.