feat: allow disabling bogofilter
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Mauro Torrez 2020-10-20 10:15:18 -03:00
parent 193eb10252
commit a61e429d76
3 changed files with 12 additions and 2 deletions

View File

@ -52,6 +52,7 @@ ENV SMTPD_MILTERS=""
ENV NON_SMTPD_MILTERS="\$smtpd_milters" ENV NON_SMTPD_MILTERS="\$smtpd_milters"
ENV MILTER_DEFAULT_ACTION=accept ENV MILTER_DEFAULT_ACTION=accept
ENV INTERNAL_MAIL_FILTER_CLASSES=bounce ENV INTERNAL_MAIL_FILTER_CLASSES=bounce
ENV BOGOFILTER_ENABLE=""
# TODO: template access lists # TODO: template access lists

View File

@ -12,4 +12,5 @@ keys = [
"/postscreen/dnsbl/threshold", "/postscreen/dnsbl/threshold",
"/postscreen/dnsbl/whitelist/threshold", "/postscreen/dnsbl/whitelist/threshold",
"/postscreen/greet/action", "/postscreen/greet/action",
"/bogofilter/enable",
] ]

View File

@ -52,9 +52,11 @@ postconf -F dnsblog/unix/private=- \
dnsblog/unix/process_limit=0 \ dnsblog/unix/process_limit=0 \
dnsblog/unix/command="dnsblog" dnsblog/unix/command="dnsblog"
{{ if eq (getv "/bogofilter/enable") "yes" }}
postconf -P smtpd/pass/content_filter=spamfilter postconf -P smtpd/pass/content_filter=spamfilter
{{ else }}
postconf -X -P smtpd/pass/content_filter
{{ end }}
# FIXME: template tables instead of creating empty files # FIXME: template tables instead of creating empty files
touch /etc/postfix/rules/postscreen_access_list.cidr touch /etc/postfix/rules/postscreen_access_list.cidr
@ -81,7 +83,13 @@ postconf -F smtp/inet/private=n \
smtp/inet/wakeup=- \ smtp/inet/wakeup=- \
smtp/inet/process_limit=- \ smtp/inet/process_limit=- \
smtp/inet/command="smtpd" smtp/inet/command="smtpd"
{{ if eq (getv "/bogofilter/enable") "yes" }}
postconf -P smtp/inet/content_filter=spamfilter postconf -P smtp/inet/content_filter=spamfilter
{{ else }}
postconf -X -P smtp/inet/content_filter
{{ end }}
postconf -M# dnsblog/unix postconf -M# dnsblog/unix
{{ end }} {{ end }}