Hi,
the error
-su: 70: Syntax error: Bad fd number
dpkg: error processing package spamassassin (--configure):
subprocess installed post-installation script returned error exit status 2
is caused by choosen shell.
I debugged /var/lib/dpkg/info/spamassassin.postinst and found line 29 raising the error:
su - $OWNER -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys \
--import /usr/share/spamassasini/GPG.KEY"
A bit testing shows: It is impossible to do
su - $OWNER -c "ANNY COMMAND"
$OWNER is debian-spamd. I checked getent passwd and found /bin/sh as shell for debian-spamd. /bin/sh is linked to /bin/dash. iRedMail.sh was executed in /bin/bash so I changed shell of debian-spamd to /bin/bash. Now I was able to execute the failing command.
User debian-spamd is created by the script /var/lib/dpkg/info/spamassassin.postinst if it does not exist. So I used a fresh Ubuntu 14.04.1 and created user debian-spamd like line 7/8 except I set bash as shell. Then I started installation of iRedMail and it worked like a charm.
I have no idea, why /bin/dash does not work, but using bash instead is a nice workaround for me. So perhaps you like to add an extra line to iRedMail to create user debian-spamd before installation of spamassasin.
I have no hope, that Canaonical fixes this bug in a short time. They are not as flexible as you.
Edit:
I just posted this bug on
https://lists.ubuntu.com/archives/ubunt … 15281.html
Hope Canonical will fix it.