Skip to content
Dovecot FTS plugin based on Xapian
Branch: master
Clone or download
Latest commit 9a94b4a May 28, 2019

FTS Xapian plugin for Dovecot

What is this?

This project intends to provide a straightforward and simple way to configure FTS plugin for Dovecot, leveraging the efforts by the team.

This effort came after Dovecot team decided to deprecate "fts_squat" included in the dovecot core, and due to the complexity of the Solr plugin capabilitles, un-needed for most users.


You are going to need the following things to get this going:

* Dovecot above 2.3.x (untested with previous versions)
* Xapian 1.4.x (or above)
* ICU 

You will need to configure properly Users Home Directories in dovecot configuration

Installing the Dovecot plugin

First install the following packages, or equivalent for your operating system.

apt-get build-dep dovecot-core
apt-get install git dovecot-dev
apt-get install xapian-core
apt-get install libicu-dev

pacman -S dovecot
pacman -S xapian-core
pacman -S icu

Clone this project:

git clone
cd fts-xapian

Compile and install the plugin.

autoreconf -vi
PANDOC=false ./configure --with-dovecot=/path/to/dovecot
sudo make install

Replace /path/to/dovecot by the actual path to 'dovecot-config'.
Type 'locate dovecot-config' in a shell to figure this out. On ArchLinux , it is /usr/lib/dovecot. 

The module will be placed into the module directory of your dovecot configuration

Update your dovecot.conf file with something similar to:

default_vsz_limit = 2GB // or above

mail_plugins = fts fts_xapian (...)


plugin {
	plugin = fts fts_xapian (...)

	fts = xapian
	fts_xapian = partial=2 full=20

	fts_autoindex = yes
	fts_enforced = yes

note: 2 and 20 are the NGram values for header fields, which means the keywords created for fields (To, Cc, ...) are between is 2 and 20 chars long. Full words are also added by default.

Example: "john@doe" will create jo, oh, ... , @d, do, .. joh, ohn, hn@, ..., john@d, ohn@do, ..., and finally john@doe as searchable keywords.

Restart Dovecot:

sudo servicectl restart dovecot

If this is not a fresh install of dovecot, you need to re-index your mailboxes

doveadm index -A -q \*

The first index will re-index all emails, therefore may take a while.


Please submit requests/bugs via the GitHub issue tracker.

Thanks to Aki Tuomi, Stephan Bosh, Paul Hecker

You can’t perform that action at this time.