diff --git a/core/dovecot/Dockerfile b/core/dovecot/Dockerfile index bb67370c..da75140c 100644 --- a/core/dovecot/Dockerfile +++ b/core/dovecot/Dockerfile @@ -1,4 +1,15 @@ ARG DISTRO=alpine:3.10 +FROM $DISTRO as builder +WORKDIR /tmp +RUN apk add git build-base automake autoconf libtool dovecot-dev xapian-core-dev icu-dev +RUN git clone https://github.com/grosjo/fts-xapian.git \ + && cd fts-xapian \ + && git checkout 1.2.7 \ + && autoreconf -vi \ + && PANDOC=false ./configure --with-dovecot=/usr/lib/dovecot \ + && make \ + && make install + FROM $DISTRO # python3 shared with most images RUN apk add --no-cache \ @@ -13,9 +24,11 @@ RUN pip3 install "podop>0.2.5" # Image specific layers under this line RUN apk add --no-cache \ - dovecot dovecot-lmtpd dovecot-pop3d dovecot-submissiond dovecot-pigeonhole-plugin rspamd-client \ + dovecot dovecot-lmtpd dovecot-pop3d dovecot-submissiond dovecot-pigeonhole-plugin rspamd-client xapian-core \ && mkdir /var/lib/dovecot +COPY --from=builder /usr/lib/dovecot/lib21_fts_xapian_plugin.* /usr/lib/dovecot/ + COPY conf /conf COPY start.py /start.py diff --git a/core/dovecot/conf/dovecot.conf b/core/dovecot/conf/dovecot.conf index f4181e0c..aa33a7bb 100644 --- a/core/dovecot/conf/dovecot.conf +++ b/core/dovecot/conf/dovecot.conf @@ -21,7 +21,8 @@ mail_access_groups = mail maildir_stat_dirs = yes mailbox_list_index = yes mail_vsize_bg_after_count = 100 -mail_plugins = $mail_plugins quota quota_clone zlib +mail_plugins = $mail_plugins quota quota_clone zlib fts fts_xapian +default_vsz_limit = 2GB namespace inbox { inbox = yes @@ -38,6 +39,12 @@ plugin { quota_vsizes = yes quota_clone_dict = proxy:/tmp/podop.socket:quota + fts = xapian + fts_xapian = partial=2 full=30 + fts_autoindex = yes + fts_enforced = yes + fts_autoindex_exclude = \Trash + {% if COMPRESSION in [ 'gz', 'bz2' ] %} zlib_save = {{ COMPRESSION }} {% endif %} diff --git a/towncrier/newsfragments/1320.feature b/towncrier/newsfragments/1320.feature new file mode 100644 index 00000000..fc3fd5aa --- /dev/null +++ b/towncrier/newsfragments/1320.feature @@ -0,0 +1 @@ +Allow users to use server-sided full-text-search again by adding the dovecot fts-xapian plugin