From 0954fd50fb962fd4bb85439c5183acea7350b3c4 Mon Sep 17 00:00:00 2001 From: Fabian Letzkus Date: Sun, 25 Jun 2017 16:12:44 +0000 Subject: [PATCH 1/2] Added configuration paramter to replace clamav with none --- rmilter/rmilter-clamav.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 rmilter/rmilter-clamav.conf diff --git a/rmilter/rmilter-clamav.conf b/rmilter/rmilter-clamav.conf new file mode 100644 index 00000000..b8f38f5e --- /dev/null +++ b/rmilter/rmilter-clamav.conf @@ -0,0 +1,18 @@ +clamav { + # servers - clamav socket definitions in format: + servers = antivirus:3310; + # connect_timeout - timeout in miliseconds for connecting to clamav + connect_timeout = 1s; + # port_timeout - timeout in miliseconds for waiting for clamav port response + port_timeout = 4s; + # results_timeout - timeout in miliseconds for waiting for clamav response + results_timeout = 20s; + # error_time - time in seconds during which we are counting errors + error_time = 10; + # dead_time - time in seconds during which we are thinking that server is down + dead_time = 300; + # maxerrors - maximum number of errors that can occur during error_time to make us thinking that + # Default: 10 + maxerrors = 10; +}; + From 117e858df3148e27947b662ff633290979b42aa1 Mon Sep 17 00:00:00 2001 From: Fabian Letzkus Date: Sun, 25 Jun 2017 16:15:47 +0000 Subject: [PATCH 2/2] Added parameter checking in rmilter image, added parameter in docker-compose, added parameter in .env --- .env.dist | 3 +++ docker-compose.yml.dist | 2 +- rmilter/Dockerfile | 1 + rmilter/rmilter.conf | 18 ------------------ rmilter/start.sh | 4 ++++ 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.env.dist b/.env.dist index 1a1f3b67..8ad95aba 100644 --- a/.env.dist +++ b/.env.dist @@ -51,6 +51,9 @@ EXPOSE_ADMIN=no # Dav server implementation (value: radicale, none) WEBDAV=none +# Antivirus solution (value: none, clamav) +ANTIVIRUS=clamav + ################################### # Mail settings ################################### diff --git a/docker-compose.yml.dist b/docker-compose.yml.dist index 8b6ae76d..ca809af6 100644 --- a/docker-compose.yml.dist +++ b/docker-compose.yml.dist @@ -70,7 +70,7 @@ services: antivirus: # build: clamav - image: mailu/clamav:$VERSION + image: mailu/$ANTIVIRUS:$VERSION restart: always env_file: .env volumes: diff --git a/rmilter/Dockerfile b/rmilter/Dockerfile index 9f474de7..950abbe5 100644 --- a/rmilter/Dockerfile +++ b/rmilter/Dockerfile @@ -4,6 +4,7 @@ RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/re && apk add --no-cache rmilter@testing rsyslog COPY rmilter.conf /etc/rmilter.conf +COPY rmilter-clamav.conf /etc/rmilter-clamav.conf COPY rsyslog.conf /etc/rsyslog.conf COPY start.sh /start.sh diff --git a/rmilter/rmilter.conf b/rmilter/rmilter.conf index 991adf9b..28ef6593 100644 --- a/rmilter/rmilter.conf +++ b/rmilter/rmilter.conf @@ -20,24 +20,6 @@ strict_auth = no; use_dcc = no; use_redis = yes; -clamav { - # servers - clamav socket definitions in format: - servers = antivirus:3310; - # connect_timeout - timeout in miliseconds for connecting to clamav - connect_timeout = 1s; - # port_timeout - timeout in miliseconds for waiting for clamav port response - port_timeout = 4s; - # results_timeout - timeout in miliseconds for waiting for clamav response - results_timeout = 20s; - # error_time - time in seconds during which we are counting errors - error_time = 10; - # dead_time - time in seconds during which we are thinking that server is down - dead_time = 300; - # maxerrors - maximum number of errors that can occur during error_time to make us thinking that - # Default: 10 - maxerrors = 10; -}; - spamd { # servers - spamd socket definitions in format: servers = r:antispam:11333; diff --git a/rmilter/start.sh b/rmilter/start.sh index 2521ea98..d333a86a 100755 --- a/rmilter/start.sh +++ b/rmilter/start.sh @@ -1,5 +1,9 @@ #!/bin/sh rm -f /var/run/rsyslogd.pid +if [ "$ANTIVIRUS" == "clamav" ]; +then + echo "# .try_include /etc/rmilter-clamav.conf" >> /etc/rmilter.conf +fi rmilter -c /etc/rmilter.conf rsyslogd -n