In this post, I’ll walk you through how to install, configure, and index emails using fts_xapian, so you get instant results in Roundcube’s search box.
⸻
Requirements:
- myVesta server (Debian 12)
- Dovecot 2.3.19.1 or newer
- Roundcube Webmail
Step 1: Install the fts_xapian plugin for Dovecot
Run this command:
Code: Select all
apt update
apt install dovecot-fts-xapian -y
Step 2: Configure Dovecot to use fts_xapian
1. Edit the file:
Code: Select all
nano /etc/dovecot/conf.d/90-plugin.conf
Code: Select all
plugin {
fts = xapian
fts_autoindex = yes
}
Code: Select all
nano /etc/dovecot/conf.d/10-mail.conf
Code: Select all
mail_plugins = $mail_plugins fts fts_xapian
Step 3: Restart Dovecot
Code: Select all
systemctl restart dovecot
Step 4: Manually index existing emails
FTS auto-indexing works for new messages, but for existing inboxes you need to index manually.
To index only INBOX:
Code: Select all
doveadm index -u [email protected] INBOX
Code: Select all
doveadm mailbox list -u [email protected] | while read box; do
doveadm index -u [email protected] “$box”
done
You can monitor index creation via:
Code: Select all
watch -n 1 ‘du -sh /home/user/mail/domain/office(or some other email adress)/xapian-indexes’
Step 5: Test Roundcube search
Now go to Roundcube and test searching for any word that exists in old emails. The results should be instant (under 1 second), even with thousands of messages.
⸻
Notes:
- If your Dovecot version is older than 2.3.11, this setup may not be needed - search is faster by default.
- FTS is especially useful if your users have large mailboxes or use IMAP search frequently.