Package: spamassassin
Version: 3.4.2-1~deb9u1

The installation or update of spamassassin
aborts with the following error message:

$ aptitude install spamassassin
[...]
Errors were encountered while processing:
spamassassin
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up spamassassin (3.4.2-1~deb9u1) ...
This account is currently not available.

This happens when the user account debian-spamd is setup with invalid
login shell, preventing manual login to the account:
$ grep debian-spamd /etc/passwd
debian-spamd:x:111:114::/var/lib/spamassassin:/usr/sbin/nologin

This is the (reasonable) default setup of the account, so I don't want
to assign a valid login shell to this account.

Instead I worked around this issue with the following change in the
postinst script /var/lib/dpkg/info/spamassassin.postinst
  Line 38
          su - $OWNER -c "sa-update \
         --gpghomedir /var/lib/spamassassin/sa-update-keys \
         --import /usr/share/spamassassin/GPG.KEY"
Replace: "su - $OWNER -c " --> "sudo -u $OWNER sh -c"

sudo does work with disabled accounts, su doesn't

Reply via email to