public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Rspamd] Auto-generate SIEVE_HOST map and add dnsutils
5e360188
data/Dockerfiles/rspamd/Dockerfile | 2 +-
data/Dockerfiles/rspamd/docker-entrypoint.sh | 26 ++++++++++++++++++++------
2 files changed, 21 insertions(+), 7 deletions(-)
Diff
diff --git a/data/Dockerfiles/rspamd/Dockerfile b/data/Dockerfiles/rspamd/Dockerfile
index 87d92139..143c7f82 100644
--- a/data/Dockerfiles/rspamd/Dockerfile
+++ b/data/Dockerfiles/rspamd/Dockerfile
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \
apt-transport-https \
&& apt-key adv --fetch-keys https://rspamd.com/apt/gpg.key \
&& echo "deb https://rspamd.com/apt-stable/ bionic main" > /etc/apt/sources.list.d/rspamd.list \
- && apt-get update && apt-get install -y rspamd \
+ && apt-get update && apt-get install -y rspamd dnsutils \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove --purge \
&& apt-get clean \
diff --git a/data/Dockerfiles/rspamd/docker-entrypoint.sh b/data/Dockerfiles/rspamd/docker-entrypoint.sh
index 6facf35a..34cdee09 100755
--- a/data/Dockerfiles/rspamd/docker-entrypoint.sh
+++ b/data/Dockerfiles/rspamd/docker-entrypoint.sh
@@ -6,6 +6,26 @@ mkdir -p /etc/rspamd/plugins.d \
touch /etc/rspamd/rspamd.conf.local \
/etc/rspamd/rspamd.conf.override
+chmod 755 /var/lib/rspamd
+
+[[ ! -f /etc/rspamd/override.d/worker-controller-password.inc ]] && echo '# Placeholder' > /etc/rspamd/override.d/worker-controller-password.inc
+[[ ! -f /etc/rspamd/custom/sa-rules-heinlein ]] && echo '# to be auto-filled by dovecot-mailcow' > /etc/rspamd/custom/sa-rules-heinlein
+[[ ! -f /etc/rspamd/custom/dovecot_trusted.map ]] && echo '# to be auto-filled by dovecot-mailcow' > /etc/rspamd/custom/dovecot_trusted.map
+
+DOVECOT_V4=
+DOVECOT_V6=
+until [[ ! -z ${DOVECOT_V4} ]]; do
+ DOVECOT_V4=$(dig a dovecot +short)
+ DOVECOT_V6=$(dig aaaa dovecot +short)
+ [[ ! -z ${DOVECOT_V4} ]] && break;
+ echo "Waiting for Dovecot"
+ sleep 3
+done
+echo ${DOVECOT_V4}/32 > /etc/rspamd/custom/dovecot_trusted.map
+if [[ ! -z ${DOVECOT_V6} ]]; then
+ echo ${DOVECOT_V6}/128 >> /etc/rspamd/custom/dovecot_trusted.map
+fi
+
chown -R _rspamd:_rspamd /var/lib/rspamd \
/etc/rspamd/local.d \
/etc/rspamd/override.d \
@@ -14,10 +34,4 @@ chown -R _rspamd:_rspamd /var/lib/rspamd \
/etc/rspamd/rspamd.conf.override \
/etc/rspamd/plugins.d
-chmod 755 /var/lib/rspamd
-
-[[ ! -f /etc/rspamd/override.d/worker-controller-password.inc ]] && echo '# Placeholder' > /etc/rspamd/override.d/worker-controller-password.inc
-chown _rspamd:_rspamd /etc/rspamd/override.d/worker-controller-password.inc
-[[ ! -f /etc/rspamd/custom/sa-rules-heinlein ]] && echo '# to be auto-filled by dovecot-mailcow' > /etc/rspamd/custom/sa-rules-heinlein
-
exec "$@"