2017-04-04 02:06:49 +08:00
|
|
|
FROM debian:stretch-slim
|
2017-05-13 21:33:32 +08:00
|
|
|
LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-05-13 22:29:18 +08:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2017-03-02 18:23:23 +08:00
|
|
|
ENV LC_ALL C
|
2018-01-09 18:15:52 +08:00
|
|
|
ENV DOVECOT_VERSION 2.3.0
|
|
|
|
ENV PIGEONHOLE_VERSION 0.5.0.1
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2018-01-09 05:00:54 +08:00
|
|
|
RUN apt-get update && apt-get -y --no-install-recommends install \
|
2017-04-04 02:06:49 +08:00
|
|
|
automake \
|
2017-05-13 22:07:06 +08:00
|
|
|
autotools-dev \
|
|
|
|
build-essential \
|
2017-03-02 18:23:23 +08:00
|
|
|
ca-certificates \
|
2017-05-13 22:07:06 +08:00
|
|
|
cpanminus \
|
2017-03-02 18:23:23 +08:00
|
|
|
curl \
|
2017-05-13 22:07:06 +08:00
|
|
|
default-libmysqlclient-dev \
|
2017-12-18 00:45:05 +08:00
|
|
|
libjson-webtoken-perl \
|
|
|
|
libcgi-pm-perl \
|
|
|
|
libcrypt-openssl-rsa-perl \
|
|
|
|
libdata-uniqid-perl \
|
|
|
|
libhtml-parser-perl \
|
|
|
|
libmail-imapclient-perl \
|
|
|
|
libparse-recdescent-perl \
|
|
|
|
libsys-meminfo-perl \
|
|
|
|
libtest-mockobject-perl \
|
|
|
|
libwww-perl \
|
2017-03-02 18:23:23 +08:00
|
|
|
libauthen-ntlm-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
libbz2-dev \
|
2017-03-02 18:23:23 +08:00
|
|
|
libcrypt-ssleay-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
libdbd-mysql-perl \
|
|
|
|
libdbi-perl \
|
2017-03-02 18:23:23 +08:00
|
|
|
libdigest-hmac-perl \
|
|
|
|
libfile-copy-recursive-perl \
|
|
|
|
libio-compress-perl \
|
|
|
|
libio-socket-inet6-perl \
|
|
|
|
libio-socket-ssl-perl \
|
|
|
|
libio-tee-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
libipc-run-perl \
|
|
|
|
liblockfile-simple-perl \
|
|
|
|
liblz-dev \
|
|
|
|
liblz4-dev \
|
|
|
|
liblzma-dev \
|
2017-03-02 18:23:23 +08:00
|
|
|
libmodule-scandeps-perl \
|
|
|
|
libnet-ssleay-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
libpam-dev \
|
2017-03-02 18:23:23 +08:00
|
|
|
libpar-packer-perl \
|
|
|
|
libreadonly-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
libssl-dev \
|
2017-03-02 18:23:23 +08:00
|
|
|
libterm-readkey-perl \
|
|
|
|
libtest-pod-perl \
|
|
|
|
libtest-simple-perl \
|
|
|
|
libunicode-string-perl \
|
2017-11-04 03:25:38 +08:00
|
|
|
libproc-processtable-perl \
|
2017-03-02 18:23:23 +08:00
|
|
|
liburi-perl \
|
2017-05-13 22:07:06 +08:00
|
|
|
lzma-dev \
|
2017-03-02 18:23:23 +08:00
|
|
|
make \
|
2017-11-04 03:25:38 +08:00
|
|
|
procps \
|
2017-05-13 22:07:06 +08:00
|
|
|
supervisor \
|
2018-01-09 05:00:54 +08:00
|
|
|
cron \
|
2017-05-13 22:07:06 +08:00
|
|
|
syslog-ng \
|
|
|
|
syslog-ng-core \
|
|
|
|
syslog-ng-mod-redis \
|
2017-05-13 21:52:16 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-04-04 02:06:49 +08:00
|
|
|
|
2018-01-09 18:15:52 +08:00
|
|
|
RUN curl https://www.dovecot.org/releases/2.3/dovecot-$DOVECOT_VERSION.tar.gz | tar xvz \
|
|
|
|
&& cd dovecot-ce-$DOVECOT_VERSION \
|
2017-04-04 02:06:49 +08:00
|
|
|
&& ./configure --with-mysql --with-lzma --with-lz4 --with-ssl=openssl --with-notify=inotify --with-storages=mdbox,sdbox,maildir,mbox,imapc,pop3c --with-bzlib --with-zlib \
|
|
|
|
&& make -j3 \
|
|
|
|
&& make install \
|
2017-05-13 22:11:04 +08:00
|
|
|
&& make clean \
|
2018-01-09 18:15:52 +08:00
|
|
|
&& cd .. && rm -rf dovecot-ce-$DOVECOT_VERSION \
|
|
|
|
&& curl https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION.tar.gz | tar xvz \
|
|
|
|
&& cd dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION \
|
2017-04-04 02:06:49 +08:00
|
|
|
&& ./configure \
|
|
|
|
&& make -j3 \
|
|
|
|
&& make install \
|
2017-05-13 22:11:04 +08:00
|
|
|
&& make clean \
|
2017-11-04 03:25:38 +08:00
|
|
|
&& cd .. \
|
2018-01-09 18:15:52 +08:00
|
|
|
&& rm -rf dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION
|
2017-04-04 02:06:49 +08:00
|
|
|
|
2017-03-02 18:23:23 +08:00
|
|
|
RUN cpanm Data::Uniqid Mail::IMAPClient String::Util
|
|
|
|
RUN echo '* * * * * root /usr/local/bin/imapsync_cron.pl' > /etc/cron.d/imapsync
|
2017-08-01 20:02:00 +08:00
|
|
|
RUN echo '30 3 * * * vmail /usr/local/bin/doveadm quota recalc -A' > /etc/cron.d/dovecot-sync
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-05-07 05:42:18 +08:00
|
|
|
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
|
|
|
COPY imapsync /usr/local/bin/imapsync
|
|
|
|
COPY postlogin.sh /usr/local/bin/postlogin.sh
|
|
|
|
COPY imapsync_cron.pl /usr/local/bin/imapsync_cron.pl
|
|
|
|
COPY report-spam.sieve /usr/local/lib/dovecot/sieve/report-spam.sieve
|
|
|
|
COPY report-ham.sieve /usr/local/lib/dovecot/sieve/report-ham.sieve
|
|
|
|
COPY rspamd-pipe-ham /usr/local/lib/dovecot/sieve/rspamd-pipe-ham
|
|
|
|
COPY rspamd-pipe-spam /usr/local/lib/dovecot/sieve/rspamd-pipe-spam
|
|
|
|
COPY docker-entrypoint.sh /
|
|
|
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-04-04 02:06:49 +08:00
|
|
|
RUN chmod +x /usr/local/lib/dovecot/sieve/rspamd-pipe-ham \
|
|
|
|
/usr/local/lib/dovecot/sieve/rspamd-pipe-spam \
|
|
|
|
/usr/local/bin/imapsync_cron.pl \
|
|
|
|
/usr/local/bin/postlogin.sh \
|
|
|
|
/usr/local/bin/imapsync
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-04-04 02:06:49 +08:00
|
|
|
RUN groupadd -g 5000 vmail \
|
2017-04-06 04:25:34 +08:00
|
|
|
&& groupadd -g 401 dovecot \
|
2017-05-13 02:54:23 +08:00
|
|
|
&& groupadd -g 402 dovenull \
|
2017-04-04 02:06:49 +08:00
|
|
|
&& useradd -g vmail -u 5000 vmail -d /var/vmail \
|
2017-04-06 04:25:34 +08:00
|
|
|
&& useradd -c "Dovecot unprivileged user" -d /dev/null -u 401 -g dovecot -s /bin/false dovecot \
|
|
|
|
&& useradd -c "Dovecot login user" -d /dev/null -u 402 -g dovenull -s /bin/false dovenull
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-05-07 05:42:18 +08:00
|
|
|
RUN touch /etc/default/locale
|
2017-05-14 20:24:55 +08:00
|
|
|
RUN apt-get purge -y build-essential automake autotools-dev \
|
|
|
|
&& apt-get autoremove --purge -y
|
2017-05-07 05:42:18 +08:00
|
|
|
|
2017-03-02 18:23:23 +08:00
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
|
|
|
|
2017-05-13 21:52:16 +08:00
|
|
|
RUN rm -rf \
|
2017-04-04 02:06:49 +08:00
|
|
|
/tmp/* \
|
2017-05-13 22:11:04 +08:00
|
|
|
/var/tmp/*
|