Commit ab27800d authored by Lucas Détré's avatar Lucas Détré

changes in spamassassin installation routine

parent 471538dc
......@@ -31,6 +31,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
ENV POSTAL_CONFIG_ROOT=/postal/config/local
ENV PATH="/postal/bin:${PATH}"
ENV SAHOME="/var/log/spamassassin"
## Clone le projet postal
RUN git clone /postal
......@@ -46,6 +47,24 @@ RUN setcap 'cap_net_bind_service=+eip' /usr/local/bin/ruby
RUN mkdir /postal/config/local /postal/public/assets
# Spamassassin installation routine
# add group spamd
RUN groupadd spamd \
# add the user spam with /var/log/spamassassin as home directory
&& useradd -g spamd -s /bin/false -d /var/log/spamassasin spamd \
&& mkdir /var/log/spamassassin \
# change /var/log/spamassassin's ownership to spamd
&& chown spamd: /var/log/spamassassin
# Spamassassin setup
RUN update-rc.d spamassassin enable \
&& sed -i 's/CRON=0/CRON=1/' /etc/default/spamassassin \
&& sed -i 's/OPTIONS="--create-prefs --max-children 5 --helper-home-dir"/OPTIONS="--create-prefs --max-children 2 --username spamd \
-H ${SAHOME} -s ${SAHOME}spamd.log"/' /etc/default/spamassassin \
&& systemctl restart spamassassin
WORKDIR /postal
......@@ -2,11 +2,6 @@
## Replace values in spamassassin config file to enable spam checking
sed -i 's/ENABLED=0/ENABLED=1/' /etc/default/spamassassin
sed -i 's/CRON=0/CRON=1/' /etc/default/spamassassin
sudo systemctl restart spamassassin
## Wait for MySQL to start up
echo "== Waiting for MySQL to start up =="
while ! mysqladmin ping -h mysql --silent; do
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment