Add managesieve support
This commit is contained in:
parent
10d675e8a5
commit
258b4a81a8
@ -60,6 +60,7 @@ ENV \
|
|||||||
SINGLE_USER= \
|
SINGLE_USER= \
|
||||||
ANTISPAM_ENABLE=yes \
|
ANTISPAM_ENABLE=yes \
|
||||||
SIEVE_ENABLE=yes \
|
SIEVE_ENABLE=yes \
|
||||||
|
MANAGESIEVE_ENABLE=yes \
|
||||||
IMAP_URLAUTH_HOST="*" \
|
IMAP_URLAUTH_HOST="*" \
|
||||||
SSL_CLIENT_CA_DIR="/etc/ssl/certs" \
|
SSL_CLIENT_CA_DIR="/etc/ssl/certs" \
|
||||||
SSL_CLIENT_CA_FILE= \
|
SSL_CLIENT_CA_FILE= \
|
||||||
@ -72,5 +73,5 @@ ADD junk-filter.sieve /etc/dovecot/sieve/before/
|
|||||||
ADD sievec /start.d/
|
ADD sievec /start.d/
|
||||||
|
|
||||||
VOLUME ["/ssl","/vmail"]
|
VOLUME ["/ssl","/vmail"]
|
||||||
EXPOSE 110/tcp 143/tcp 587/tcp 993/tcp 995/tcp 2000/tcp
|
EXPOSE 110/tcp 143/tcp 587/tcp 993/tcp 995/tcp 4190/tcp
|
||||||
CMD ["dovecot","-F"]
|
CMD ["dovecot","-F"]
|
||||||
|
6
confd/conf.d/managesieve.toml
Normal file
6
confd/conf.d/managesieve.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[template]
|
||||||
|
src = "20-managesieve.conf.tmpl"
|
||||||
|
dest = "/etc/dovecot/local.d/20-managesieve.conf"
|
||||||
|
keys = [
|
||||||
|
"/managesieve/enable",
|
||||||
|
]
|
14
confd/templates/20-managesieve.conf.tmpl
Normal file
14
confd/templates/20-managesieve.conf.tmpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# enable managesieve protocol
|
||||||
|
protocols = $protocols {{ if eq (getv "/managesieve/enable") "yes" }}sieve{{ end }}
|
||||||
|
|
||||||
|
service managesieve-login {
|
||||||
|
inet_listener sieve {
|
||||||
|
port = 4190
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service managesieve {
|
||||||
|
}
|
||||||
|
|
||||||
|
protocol sieve {
|
||||||
|
}
|
@ -1,10 +1,12 @@
|
|||||||
plugin {
|
plugin {
|
||||||
sieve_plugins = {{ if eq (getv "/sieve/enable") "yes" }}sieve_imapsieve{{ if eq (getv "/antispam/enable") "yes" }} sieve_extprograms{{ end }}{{ end }}
|
sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||||
|
|
||||||
sieve_before = /etc/dovecot/sieve/before
|
sieve_before = /etc/dovecot/sieve/before
|
||||||
sieve_after = /etc/dovecot/sieve/after
|
sieve_after = /etc/dovecot/sieve/after
|
||||||
|
|
||||||
{{ if eq (getv "/antispam/enable") "yes" }}
|
{{ if eq (getv "/antispam/enable") "yes" }}
|
||||||
|
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||||
|
|
||||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
||||||
sieve_pipe_bin_dir = /etc/dovecot/sieve
|
sieve_pipe_bin_dir = /etc/dovecot/sieve
|
||||||
|
|
||||||
|
@ -3,11 +3,13 @@
|
|||||||
# arg 1 - spam or ham
|
# arg 1 - spam or ham
|
||||||
|
|
||||||
if [ "$1" == "ham" ]; then
|
if [ "$1" == "ham" ]; then
|
||||||
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Sn
|
/usr/bin/bogofilter -d /vmail/bogofilter -p -Sn
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "spam" ]; then
|
if [ "$1" == "spam" ]; then
|
||||||
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Ns
|
/usr/bin/bogofilter -d /vmail/bogofilter -p -Ns
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user