Add xapian full-text-search plugin to dovecot

Currently we are not able to offer our users a FTS experience after the
demise of lucene due to unfixed coredumps with musl/alpine.
We now add lucene, the only remaining maintained small/lean FTS plugin
for dovecot. It is quite simple to add to our stack: A two-stage docker
build is used to compile the fts plugin in the first stage, and copy
over only the resulting plugin-artifact to the second stage, which is
our usual dovecot container. Configuration is also minimal.
master
Dario Ernst 5 years ago
parent bd92cea3cb
commit e499d5a804

@ -1,4 +1,15 @@
ARG DISTRO=alpine:3.10
FROM $DISTRO
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 \ # TODO: when upstream releases 1.2.7, use that
&& 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=0 /usr/lib/dovecot/lib21_fts_xapian_plugin.* /usr/lib/dovecot/
COPY conf /conf
COPY start.py /start.py

@ -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 %}

Loading…
Cancel
Save