Commit 471538dc authored by Lucas Détré's avatar Lucas Détré

enable spam checking by installing spamassassin

parent f92877a8
Pipeline #3295 passed with stages
in 1 minute and 57 seconds
...@@ -7,19 +7,21 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ ...@@ -7,19 +7,21 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
##Install all necessary tools ##Install all necessary tools
RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update && apt-get install --no-install-recommends -y \
apt-utils \ apt-utils \
git-core \ git-core \
less \ less \
libcap2-bin \ libcap2-bin \
lsof \ lsof \
mariadb-client \ mariadb-client \
nodejs \ nodejs \
# Install spamassasin for spam checking incoming/outgoing messages
spamassasin \
# Install system-wide gems # Install system-wide gems
&& gem install \ && gem install \
bundler \ bundler \
procodile \ procodile \
tzinfo-data \ tzinfo-data \
## Uninstall unused packages ## Uninstall unused packages
&& apt-get -y purge \ && apt-get -y purge \
git-core \ git-core \
python-dev \ python-dev \
## Clean installation ## Clean installation
...@@ -37,12 +39,12 @@ RUN git clone https://github.com/atech/postal.git /postal ...@@ -37,12 +39,12 @@ RUN git clone https://github.com/atech/postal.git /postal
RUN postal bundle /postal/vendor/bundle RUN postal bundle /postal/vendor/bundle
# Adjust permissions # Adjust permissions
# Postal needs to be able to listen on privileged ports (for example 80, 443 and 25). # Postal needs to be able to listen on privileged ports (for example 80, 443 and 25).
# To enable this, we will allow ruby to listen on these ports. # To enable this, we will allow ruby to listen on these ports.
# On a shared server this would be a security risk however on a server dedicated to Postal, this shouldn't cause any issues. # On a shared server this would be a security risk however on a server dedicated to Postal, this shouldn't cause any issues.
RUN setcap 'cap_net_bind_service=+eip' /usr/local/bin/ruby RUN setcap 'cap_net_bind_service=+eip' /usr/local/bin/ruby
RUN mkdir /postal/config/local /postal/public/assets RUN mkdir /postal/config/local /postal/public/assets
EXPOSE 5000 EXPOSE 5000
......
#!/bin/bash #!/bin/bash
## 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 ## Wait for MySQL to start up
echo "== Waiting for MySQL to start up ==" echo "== Waiting for MySQL to start up =="
while ! mysqladmin ping -h mysql --silent; do while ! mysqladmin ping -h mysql --silent; do
......
...@@ -9,7 +9,7 @@ web_server: ...@@ -9,7 +9,7 @@ web_server:
general: general:
# This can be changed to allow messages to be sent from multiple IP addresses # This can be changed to allow messages to be sent from multiple IP addresses
use_ip_pools: true use_ip_pools: false
main_db: main_db:
# Specify the connection details for your MySQL database # Specify the connection details for your MySQL database
...@@ -60,3 +60,8 @@ smtp: ...@@ -60,3 +60,8 @@ smtp:
from_name: Postal from_name: Postal
from_address: postal@{{ POSTAL_DOMAIN }} from_address: postal@{{ POSTAL_DOMAIN }}
#enabling spamassassin daemon for spam checking
spamd:
enabled: true
host: 127.0.0.1
port: 783
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment