Add sieve support
This commit is contained in:
parent
550dbfb533
commit
079ccc654f
@ -55,6 +55,7 @@ COPY ./config/dovecot.auth /etc/dovecot/conf.d/10-auth.conf
|
||||
COPY ./config/dovecot.master /etc/dovecot/conf.d/10-master.conf
|
||||
COPY ./config/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
|
||||
COPY ./config/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
|
||||
COPY ./config/dovecot.sieve /etc/dovecot/conf.d/90-sieve.conf
|
||||
# Uncomment to add verbose logging
|
||||
COPY ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
|
||||
COPY ./config/supervisord.conf /etc/supervisord.conf
|
||||
@ -68,13 +69,21 @@ RUN chmod 755 /boot
|
||||
COPY boot.d /boot.d
|
||||
RUN chmod -R 755 /boot.d
|
||||
|
||||
# Volume to store email
|
||||
VOLUME ["/vmail"]
|
||||
|
||||
# Add user vmail that owns mail
|
||||
RUN groupadd -g 5000 vmail
|
||||
RUN useradd -g vmail -u 5000 vmail -d /vmail -m
|
||||
|
||||
# create global sieve folder/rule
|
||||
RUN mkdir -p /vmail/sieve && echo -e "require \"fileinto\";\
|
||||
\nif header :contains \"X-Spam-Flag\" \"YES\" {\
|
||||
\n fileinto \"Spam\";\
|
||||
\n}" > /vmail/sieve/spam-global.sieve && \
|
||||
chown -R vmail:vmail /vmail/sieve/
|
||||
|
||||
# Volume to store email
|
||||
VOLUME ["/vmail"]
|
||||
|
||||
EXPOSE 25 143 587
|
||||
|
||||
ENTRYPOINT /boot; /usr/bin/supervisord -n
|
||||
|
@ -1,5 +1,5 @@
|
||||
protocol lda {
|
||||
hostname = mail.docker.container
|
||||
postmaster_address = postmaster@mail.docker.container
|
||||
mail_plugin_dir = /usr/lib/dovecot/modules/lda
|
||||
mail_plugins = $mail_plugins sieve
|
||||
}
|
||||
|
4
core/config/dovecot.sieve
Normal file
4
core/config/dovecot.sieve
Normal file
@ -0,0 +1,4 @@
|
||||
plugin {
|
||||
sieve_before = /vmail/sieve/spam-global.sieve
|
||||
sieve = /vmail/%d/%n/sieve/scripts/active.sieve
|
||||
}
|
Loading…
Reference in New Issue
Block a user