Use relaynets in rmilter whitelist, fixes #140

master
kaiyou 8 years ago
parent 633d93aa8c
commit 4053273fe6

@ -1,7 +1,7 @@
FROM alpine:edge FROM alpine:edge
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add --no-cache rmilter@testing rsyslog && apk add --no-cache rmilter@testing rsyslog bash
COPY rmilter.conf /etc/rmilter.conf COPY rmilter.conf /etc/rmilter.conf
COPY rsyslog.conf /etc/rsyslog.conf COPY rsyslog.conf /etc/rsyslog.conf

@ -54,7 +54,7 @@ spamd {
# reject_message - reject message for spam # reject_message - reject message for spam
reject_message = "Spam message rejected; If this is not spam contact abuse"; reject_message = "Spam message rejected; If this is not spam contact abuse";
# whitelist - list of ips or nets that should be not checked with spamd # whitelist - list of ips or nets that should be not checked with spamd
whitelist = 127.0.0.1/32, [::1]/128; whitelist = 127.0.0.1/32, [::1]/128, {{ WHITELIST }};
# rspamd_metric - metric for using with rspamd # rspamd_metric - metric for using with rspamd
rspamd_metric = "default"; rspamd_metric = "default";
# Do not reject, add header # Do not reject, add header
@ -91,7 +91,7 @@ redis {
# limits section # limits section
limits { limits {
# Whitelisted ip or networks # Whitelisted ip or networks
limit_whitelist = 127.0.0.1, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8, [::1]/128; limit_whitelist = 127.0.0.1, [::1]/128, {{ WHITELIST }};
# Whitelisted recipients # Whitelisted recipients
limit_whitelist_rcpt = postmaster, mailer-daemon; limit_whitelist_rcpt = postmaster, mailer-daemon;
# Addrs for bounce checks # Addrs for bounce checks
@ -112,7 +112,7 @@ limits {
greylisting { greylisting {
timeout = 300s; timeout = 300s;
expire = 3d; expire = 3d;
whitelist = 127.0.0.1, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8, [::1]/128; whitelist = 127.0.0.1, [::1]/128, {{ WHITELIST }};
}; };
dkim { dkim {
@ -125,7 +125,7 @@ dkim {
body_canon = relaxed; body_canon = relaxed;
sign_alg = sha256; sign_alg = sha256;
auth_only = yes; auth_only = yes;
sign_networks = 127.0.0.1, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8, [::1]/128; sign_networks = 127.0.0.1, [::1]/128, {{ WHITELIST }};
}; };
# .try_include /overrides/rmilter.conf # .try_include /overrides/rmilter.conf

@ -1,4 +1,11 @@
#!/bin/sh #!/bin/bash
export WHITELIST=$(echo "$RELAYNETS" | sed 's/ /,/g')
# Substitute configuration
for VARIABLE in `env | cut -f1 -d=`; do
sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/rmilter.conf
done
rm -f /var/run/rsyslogd.pid rm -f /var/run/rsyslogd.pid
rmilter -c /etc/rmilter.conf rmilter -c /etc/rmilter.conf

Loading…
Cancel
Save