Add managesieve support
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 2022-08-11 01:44:21 -03:00
parent 10d675e8a5
commit 258b4a81a8
5 changed files with 29 additions and 4 deletions

View File

@ -60,6 +60,7 @@ ENV \
SINGLE_USER= \
ANTISPAM_ENABLE=yes \
SIEVE_ENABLE=yes \
MANAGESIEVE_ENABLE=yes \
IMAP_URLAUTH_HOST="*" \
SSL_CLIENT_CA_DIR="/etc/ssl/certs" \
SSL_CLIENT_CA_FILE= \
@ -72,5 +73,5 @@ ADD junk-filter.sieve /etc/dovecot/sieve/before/
ADD sievec /start.d/
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"]

View File

@ -0,0 +1,6 @@
[template]
src = "20-managesieve.conf.tmpl"
dest = "/etc/dovecot/local.d/20-managesieve.conf"
keys = [
"/managesieve/enable",
]

View 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 {
}

View File

@ -1,10 +1,12 @@
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_after = /etc/dovecot/sieve/after
{{ if eq (getv "/antispam/enable") "yes" }}
sieve_plugins = sieve_imapsieve sieve_extprograms
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
sieve_pipe_bin_dir = /etc/dovecot/sieve

View File

@ -3,11 +3,13 @@
# arg 1 - spam or ham
if [ "$1" == "ham" ]; then
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Sn
/usr/bin/bogofilter -d /vmail/bogofilter -p -Sn
exit 0
fi
if [ "$1" == "spam" ]; then
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Ns
/usr/bin/bogofilter -d /vmail/bogofilter -p -Ns
exit 0
fi
exit 1