Plesk

SpamAssassin does not work: Connection refused

Symptoms

Cause

Unclear.

Resolution

Note: This article may require additional administrative knowledge to apply. If any help required, contact the server’s administrator or hosting support.

Re-assign SpamAssassin work process on server IP address, e.g 203.0.113.2:

  1. Connect to the server via SSH.

  2. For the spamd service add the following parameters in /etc/sysconfig/spamassassin using the command below:

    # echo -e 'nSPAMDOPTIONS="-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"' >> /etc/default/spamassassin

  3. For spamc service edit /etc/mail/spamassassin/spamc.conf and add the parameter -d 203.0.113.2 in it.
    So the file will look as follows:

    # cat /etc/mail/spamassassin/spamc.conf
    -d 203.0.113.2

Re-assign SpamAssassin work process on localhost:

  1. Connect to the server via SSH

  2. Add the following parameters in /etc/default/spamassassin:

    # grep OPTIONS /etc/default/spamassassin | grep -v "#"
    OPTIONS="-i 127.0.0.1 -A 127.0.0.1 --create-prefs --daemonize --helper-home-dir=/var/qmail --max-children=1 --nouser-config --username=popuser --virtual-config-dir=/var/qmail/mailnames/%d/%l/.spamassassin"

  3. Restart the service:

    # systemctl stop spamassassin.service
    # systemctl start spamassassin.service