diff --git a/Dockerfile b/Dockerfile index 40e9838..3dab962 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,6 +85,8 @@ COPY ./config/spamassasin/spamassasin.local.append \ RUN mkdir /etc/spamassassin/.pyzor /etc/spamassassin/.razor COPY ./config/spamassasin/pyzor.servers /etc/spamassassin/.pyzor/servers RUN cat /etc/spamassassin/local.cf.append >> /etc/spamassassin/local.cf +COPY ./update-spamlists /usr/bin/update-spamlists +RUN chmod +x /usr/bin/update-spamlists # supervisord configuration COPY ./config/supervisord.conf /etc/supervisord.conf diff --git a/config/supervisord.conf b/config/supervisord.conf index 2748fb9..3258e40 100644 --- a/config/supervisord.conf +++ b/config/supervisord.conf @@ -16,3 +16,7 @@ autorestart=false [program:dovecot] command=/usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F autorestart=true + +[program:update-spamlists] +command=/usr/bin/update-spamlists +autorestart=true diff --git a/update-spamlists b/update-spamlists new file mode 100755 index 0000000..484927c --- /dev/null +++ b/update-spamlists @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +while true; do + if [[ $(date +%H) == 23 ]] ; then + razor-admin -home=/etc/spamassassin/.razor -discover + sa-update + fi +done