3

I am getting an error when trying to start spamassassin (for my postfix server). I think this error might be related to systemd as it worked before I installed the patch (I think).
I followed the ArsTechnica guide on setting up an e-mail server.

I already tried re-installing but it didn't help.
Note: The error occurs at startup of spamassassin. A --lint as postfix users yields no errors and the neccessary line is is set in v320.pre.

Here follows the config file for spamassassin:

# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

SAHOME="/var/lib/spamassassin"
SAGLOBALCFGPATH="/etc/spamassassin"

# If you're using systemd (default for jessie), the ENABLED setting is
# not used. Instead, enable spamd by issuing:
# systemctl enable spamassassin.service
# Change to "1" to enable spamd on systems using sysvinit:
ENABLED=1

# 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="-x --max-children 5 --helper-home-dir ${SAHOME} -u spamd -g spamd --siteconfigpath ${SAGLOBALCFGPATH} --socketpath=/var/spool/postfix/spamassassin/spamd.sock --socketowner=spamd --socketgroup=spamd --socketmode=0660"

# 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.
PIDFILE="/var/run/spamd.pid"

# Set nice level of spamd
#NICE="--nicelevel 15"

# Cronjob
# Set to anything but 0 to enable the cron job to automatically update
# spamassassin's rules on a nightly basis
CRON=1

Here's the log-file describing the error.


May 11 20:41:28 raspberrysyncserver spamd[21486]: logger: removing stderr method
May 11 20:41:36 raspberrysyncserver spamd[21488]: Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan!
May 11 20:41:36 raspberrysyncserver spamd[21488]: Check the necessary '.pre' files are in the config directory.
May 11 20:41:36 raspberrysyncserver spamd[21486]: child process [21488] exited or timed out without signaling production of a PID file: exit 255 at /usr/sbin/spamd line 2960.

If you need anything else please tell me, I'll provide as soon as possible.

12

Check out this blog post.

This has to do with upgrading to Jessie and how variables are handled.

The upgrade to Jessie, which involves the switch from init to systemd has caused that variables won't be expanded any longer. As the guide suggests to put the paths $SAGLOBALCFGPATH and $SAHOME paths in variables which are referenced in the OPTIONS string this of course fails as they won't get expanded any longer.

The solution is rather simple: Go into etc/default/spamassassin and replace the variables (manually) with their paths. This means that you replace ${SAHOME} with /var/lib/spamassassin and ${SAGLOBALCFGPATH}$ with /etc/spamassassin if you've used the default parameters.

  • Could you maybe summarize or quote the relevant bit so your answer will continue to be useful in case of bitrot? – Katherine Villyard May 24 '15 at 22:45
  • Great that you've found this, thank you very much! I proposed an edit to your answer to include why this failed and how to fix it. You may want to use that as a basis for further extensions if you want. – SEJPM May 25 '15 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.