diff --git a/Dockerfile b/Dockerfile index b3d3417..b560082 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM thallian/confd-env:latest -RUN apk add --no-cache postfix postfix-ldap rsyslog spamassassin-client libstdc++ g++ make tar +RUN apk add --no-cache postfix postfix-ldap rsyslog spamassassin-client libstdc++ g++ make tar RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted libmilter-dev RUN mkdir /tmp/spamass-milter diff --git a/rootfs/etc/confd/templates/main.cf.tmpl b/rootfs/etc/confd/templates/main.cf.tmpl index 6ed8ae7..f076cc7 100644 --- a/rootfs/etc/confd/templates/main.cf.tmpl +++ b/rootfs/etc/confd/templates/main.cf.tmpl @@ -48,9 +48,11 @@ smtpd_sasl_auth_enable = yes smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination smtpd_milters = + unix:/var/run/spamass-milter/spamass.sock non_smtpd_milters = $smtpd_milters milter_default_action = accept milter_macro_daemon_name = ORIGINATING +milter_connect_macros = "i j {daemon_name} v {if_name} _" message_size_limit = {{getenv "MESSAGESIZELIMIT"}} diff --git a/rootfs/etc/services.d/spamass-milter/run b/rootfs/etc/services.d/spamass-milter/run new file mode 100644 index 0000000..37aa9cc --- /dev/null +++ b/rootfs/etc/services.d/spamass-milter/run @@ -0,0 +1,3 @@ + #!/usr/bin/with-contenv sh + +s6-setuidgid postfix spamass-milter -u -p /var/run/spamass-milter/spamass.sock -- -d spamassassin