1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

simplify build/setup of dovecot-lucene package

This commit is contained in:
Joshua Tauberer
2015-06-01 21:04:20 -04:00
parent f02e0a3ccb
commit b23ba6f75e
7 changed files with 47 additions and 59 deletions

View File

@@ -1,48 +0,0 @@
#!/bin/bash
# IMAP search with lucene
# --------------------------------
#
# Adapted from https://github.com/Jonty/mailinabox/blob/solr_support/setup/solr.sh
#
# By default dovecot uses its own Squat search index that has awful performance
# on large mailboxes. Dovecot 2.1+ has support for using Lucene internally but
# this didn't make it into the Ubuntu packages, so we maintain our own
# dovecot-lucene package in a ppa.
source setup/functions.sh # load our functions
source /etc/mailinabox.conf # load global vars
# Install packages and basic configuation
# ---------------------------------------
# Add official ppa
hide_output add-apt-repository -y ppa:mail-in-a-box/ppa
# Update apt
hide_output apt-get update
# Install packages
apt_install dovecot-lucene
# Update the dovecot plugin configuration
#
# Break-imap-search makes search work the way users expect, rather than the way
# the IMAP specification expects
tools/editconf.py /etc/dovecot/conf.d/10-mail.conf \
mail_plugins="$mail_plugins fts fts_lucene"
cat > /etc/dovecot/conf.d/90-plugin.conf << EOF;
plugin {
fts = lucene
fts_lucene = whitespace_chars=@.
}
EOF
# PERMISSIONS
# Ensure configuration files are owned by dovecot and not world readable.
chown -R mail:dovecot /etc/dovecot
chmod -R o-rwx /etc/dovecot
# Restart services to reload dovecot plugins
restart_service dovecot

View File

@@ -18,11 +18,14 @@
source setup/functions.sh # load our functions
source /etc/mailinabox.conf # load global vars
# Install packages...
# Install packages for dovecot. These are all core dovecot plugins,
# but dovecot-lucene is packaged by *us* in the Mail-in-a-Box PPA,
# not by Ubuntu.
apt_install \
dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-sqlite sqlite3 \
dovecot-sieve dovecot-managesieved
dovecot-sieve dovecot-managesieved dovecot-lucene
# The `dovecot-imapd`, `dovecot-pop3d`, and `dovecot-lmtpd` packages automatically
# enable IMAP, POP and LMTP protocols.
@@ -92,6 +95,17 @@ tools/editconf.py /etc/dovecot/conf.d/20-imap.conf \
tools/editconf.py /etc/dovecot/conf.d/20-pop3.conf \
pop3_uidl_format="%08Xu%08Xv"
# Full Text Search - Enable full text search of mail using dovecot's lucene plugin,
# which *we* package and distribute (dovecot-lucene package).
tools/editconf.py /etc/dovecot/conf.d/10-mail.conf \
mail_plugins="\$mail_plugins fts fts_lucene"
cat > /etc/dovecot/conf.d/90-plugin-fts.conf << EOF;
plugin {
fts = lucene
fts_lucene = whitespace_chars=@.
}
EOF
# ### LDA (LMTP)
# Enable Dovecot's LDA service with the LMTP protocol. It will listen

View File

@@ -139,7 +139,6 @@ source setup/mail-postfix.sh
source setup/mail-dovecot.sh
source setup/mail-users.sh
source setup/dkim.sh
source setup/lucene.sh
source setup/spamassassin.sh
source setup/web.sh
source setup/webmail.sh

View File

@@ -3,7 +3,21 @@ source setup/functions.sh # load our functions
# Basic System Configuration
# -------------------------
# ### Install Packages
# ### Add Mail-in-a-Box's PPA.
# We've built several .deb packages on our own that we want to include.
# One is a replacement for Ubuntu's stock postgrey package that makes
# some enhancements. The other is dovecot-lucene, a Lucene-based full
# text search plugin for (and by) dovecot, which is not available in
# Ubuntu currently.
#
# Add that to the system's list of repositories:
hide_output add-apt-repository -y ppa:mail-in-a-box/ppa
# The apt-get update in the next step will pull in the PPA's index.
# ### Update Packages
# Update system packages to make sure we have the latest upstream versions of things from Ubuntu.
@@ -11,6 +25,8 @@ echo Updating system packages...
hide_output apt-get update
apt_get_quiet upgrade
# ### Install System Packages
# Install basic utilities.
#
# * haveged: Provides extra entropy to /dev/random so it doesn't stall