Add ham/spam cutoff parameters to spamfilter
This commit is contained in:
parent
c80027a5a8
commit
fcea79f08f
@ -54,6 +54,8 @@ 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="yes"
|
ENV BOGOFILTER_ENABLE="yes"
|
||||||
|
ENV BOGOFILTER_HAM_CUTOFF="0.499999"
|
||||||
|
ENV BOGOFILTER_SPAM_CUTOFF="0.499999"
|
||||||
|
|
||||||
# TODO: template access lists
|
# TODO: template access lists
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ RUN echo "_dev_null: /dev/null" > /etc/aliases \
|
|||||||
scache/unix/chroot=n
|
scache/unix/chroot=n
|
||||||
|
|
||||||
ADD confd /etc/confd/
|
ADD confd /etc/confd/
|
||||||
ADD postmap_all spamfilter /usr/local/bin/
|
ADD postmap_all /usr/local/bin/
|
||||||
|
|
||||||
VOLUME ["/ssl","/var/spool/postfix"]
|
VOLUME ["/ssl","/var/spool/postfix"]
|
||||||
EXPOSE 25/tcp 587/tcp
|
EXPOSE 25/tcp 587/tcp
|
||||||
|
8
confd/conf.d/spamfilter.toml
Normal file
8
confd/conf.d/spamfilter.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[template]
|
||||||
|
src = "spamfilter.tmpl"
|
||||||
|
dest = "/usr/local/bin/spamfilter"
|
||||||
|
mode = "0755"
|
||||||
|
keys = [
|
||||||
|
"/bogofilter/ham/cutoff",
|
||||||
|
"/bogofilter/spam/cutoff",
|
||||||
|
]
|
6
confd/templates/spamfilter.tmpl
Executable file
6
confd/templates/spamfilter.tmpl
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# pass mail through spam filter Bogofilter
|
||||||
|
# arguments are passed on to sendmail
|
||||||
|
|
||||||
|
/usr/bin/bogofilter -d /vmail/bogofilter -p {{ with getv "/bogofilter/ham/cutoff" }}--ham-cutoff {{.}}{{ end }} {{ with getv "/bogofilter/spam/cutoff" }}--spam-cutoff {{.}}{{ end }} | /usr/sbin/sendmail "$@"
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# pass mail through spam filter Bogofilter
|
|
||||||
# arguments are passed on to sendmail
|
|
||||||
|
|
||||||
/usr/bin/bogofilter -d /vmail/bogofilter -p | /usr/sbin/sendmail "$@"
|
|
Loading…
x
Reference in New Issue
Block a user