File tree Expand file tree Collapse file tree 8 files changed +60
-74
lines changed Expand file tree Collapse file tree 8 files changed +60
-74
lines changed Original file line number Diff line number Diff line change 3737 $(compose-production ) logs mda
3838 $(compose-production ) logs web
3939 $(compose-production ) logs db
40+ $(compose-production ) logs spamassassin
Original file line number Diff line number Diff line change @@ -33,11 +33,13 @@ services:
3333 build : ./web
3434 restart : on-failure:5
3535 env_file : .env
36+ mem_limit : 128M
3637
3738 spamassassin :
3839 image : jeboehm/mailserver-spamassassin:latest
3940 build : ./spamassassin
4041 restart : on-failure:5
42+ mem_limit : 192M
4143
4244volumes :
4345 data-db :
Original file line number Diff line number Diff line change 1- FROM debian:jessie
1+ FROM alpine:3.6
22MAINTAINER Jeffrey Boehm
"[email protected] " 33
4- RUN apt-get update && \
5- apt-get install -y --no-install-recommends \
6- supervisor \
7- spamassassin \
8- pyzor \
9- razor \
10- spamass-milter && \
11- rm -rf /var/lib/apt/lists/*
4+ ENV SPAMASS_USER=spamass \
5+ SPAMASS_GROUP=spamass \
6+ SPAMASS_CONF=/var/lib/spamassassin \
7+ SA_HOME=/var/lib/spamassassin/.spamassassin \
8+ SA_PORT=1783
9+
10+ RUN apk --no-cache add \
11+ libgcc \
12+ libmilter-dev \
13+ libstdc++ \
14+ openssl \
15+ perl-mail-spf \
16+ python3 \
17+ razor \
18+ spamassassin \
19+ spamassassin-client \
20+ supervisor \
21+ wget && \
22+ apk --no-cache add --virtual .fetch-deps \
23+ autoconf \
24+ automake \
25+ build-base && \
26+ pip3 install \
27+ pyzor && \
28+ wget https://github.com/andybalholm/spamass-milter/archive/master.tar.gz && \
29+ tar -xvf master.tar.gz && \
30+ cd spamass-milter-master && \
31+ ./autogen.sh && \
32+ make && \
33+ make install && \
34+ cd / && \
35+ rm -rf spamass-milter-master master.tar.gz && \
36+ apk del .fetch-deps && \
37+ addgroup -S ${SPAMASS_GROUP} && \
38+ adduser -D ${SPAMASS_USER} -G ${SPAMASS_GROUP} && \
39+ chgrp ${SPAMASS_GROUP} ${SPAMASS_CONF} && \
40+ chmod 775 ${SPAMASS_CONF}
41+
42+ USER ${SPAMASS_USER}
43+ VOLUME ["${SPAMASS_CONF}" ]
1244
1345COPY rootfs/ /
1446
1547EXPOSE 9999
1648
17- VOLUME /var/lib/spamassassin
18-
49+ HEALTHCHECK CMD spamc -K -p ${SA_PORT} || exit 1
1950CMD ["/usr/bin/supervisord" ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22nodaemon=true
33logfile=/dev/stderr
44logfile_maxbytes=0
5- pidfile=/var/run /supervisord.pid
5+ pidfile=/tmp /supervisord.pid
66
77[program:sa-update]
88command=/usr/local/bin/sa-update.sh
99redirect_stderr=true
1010stdout_logfile=/dev/stderr
1111stdout_logfile_maxbytes=0
12- stderr_logfile=/dev/stderr
13- stderr_logfile_maxbytes=0
1412
1513[program:spamd]
1614command=/usr/local/bin/spamd.sh
1715redirect_stderr=true
1816stdout_logfile=/dev/stderr
1917stdout_logfile_maxbytes=0
20- stderr_logfile=/dev/stderr
21- stderr_logfile_maxbytes=0
2218
2319[program:spamass-milter]
24- command=spamass-milter -p inet:
[email protected] -
u spamass-milter 20+ command=spamass-milter -p inet:
[email protected] -
- -p %(ENV_SA_PORT)s 2521redirect_stderr=true
2622stdout_logfile=/dev/stderr
2723stdout_logfile_maxbytes=0
28- stderr_logfile=/dev/stderr
29- stderr_logfile_maxbytes=0
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ echo asd > /tmp/spam
4+ spamassassin -t -D < /tmp/spam
5+ rm /tmp/spam
Original file line number Diff line number Diff line change 11#! /bin/sh
2-
3- PIDFILE=" /run/spamd.pid"
2+ PIDFILE=" ${SA_HOME} /spamd.pid"
43
54do_update () {
6- start-stop-daemon \
7- --chuid debian-spamd:debian-spamd --start \
8- --exec /usr/bin/sa-update -- \
9- --gpghomedir /var/lib/spamassassin/sa-update-keys 2>&1
5+ /usr/bin/sa-update \
6+ --gpghomedir ${SA_HOME} /sa-update-keys 2>&1
107}
118
129do_reload () {
Original file line number Diff line number Diff line change 11#! /bin/sh
2- SA_HOME=" /var/lib/spamassassin/.spamassassin"
3- PYZOR_HOME=" /var/lib/spamassassin/.pyzor"
4- RAZOR_HOME=" /var/lib/spamassassin/.razor"
52echo " Starting spamassassin.."
63
7- create_homedir () {
8- if ! [ -d ${SA_HOME} ]
9- then
10- mkdir ${SA_HOME}
11- chown debian-spamd ${SA_HOME}
12- fi
13- }
14-
15- pyzor_discover () {
16- start-stop-daemon \
17- --chuid debian-spamd:debian-spamd --start \
18- --exec /usr/bin/pyzor -- \
19- --homedir ${PYZOR_HOME} discover
20- }
21-
22- razor_setup () {
23- if [ -d ${RAZOR_HOME} ]
24- then
25- return 0
26- fi
27-
28- mkdir ${RAZOR_HOME}
29-
30- razor-admin -home=${RAZOR_HOME} -register
31- razor-admin -home=${RAZOR_HOME} -create
32- razor-admin -home=${RAZOR_HOME} -discover
33- }
34-
35- create_homedir
36- pyzor_discover
37- razor_setup
38-
394/usr/local/bin/sa-update.sh --startup
405
41- spamd \
42- --username=debian-spamd \
6+ /usr/sbin/spamd \
437 --syslog stderr \
44- --pidfile=/run /spamd.pid \
8+ --pidfile=${SA_HOME} /spamd.pid \
459 --max-children 5 \
46- --helper-home-dir \
47- --nouser-config
10+ --helper-home-dir=${SA_HOME} \
11+ --nouser-config \
12+ --listen 127.0.0.1:${SA_PORT}
You can’t perform that action at this time.
0 commit comments