HOWTO
# Cyrus IMAP
# ==========
# Below I have two different versions of the Cyrus IMAP server. The latest
# of the 2.4.x (legacy) tree and the latest of the 2.5.x (stable/current)
# tree. Some items in the prerequisites list below may only apply to the
# newer one.
# As this is written, the latest development version is:
#
3.0.0-beta3
# Old releases on the ftp.cyrusimap.org FTP server are moved to a
# OLD-VERSIONS subdirectory. If you try to download it as done below and
# it's not there, there may be a newer release available.
# You can read about new releases on the web site or the cyrus-announce
# mailing list:
#
http://www.cyrusimap.org/feedback-mailing-lists.html
#
https://lists.andrew.cmu.edu/pipermail/cyrus-announce/
# I use Cyrus with Berkeley DB, sendmail, and without newsgroups (without
# INN). To avoid having a howto that's as long as a book (to cover every
# variation) the howto follows as though that were true for you as well.
# It also assumes that you are either doing a new installation or are
# upgrading from the previous release. If you are upgrading from an older
# one, see doc/install-upgrade.html for other things you may need to do.
# Prerequisites:
# If you run autoreconf:
#
autoconf
#
automake
#
libtool
#
bison
#
Cyrus SASL (compiled with the same version of bdb)
#
flex
#
pcre
#
gperf
# libcap (if you pass --with-libcap)
#
Jansson (optional; for the Cyrus httpd service)
#
util-linux's libuuid
#
OpenSSL >= 0.9.4 (if you want imaps, pop3s)
#
pkg-config >= 0.9.0
# Used with 'make check' (optional):
#
CUnit
# Cyrus SASL's plain
# Cyrus SASL's md5
#
Berkeley DB >= 3.0.55 (optional)
#
groff (optional)
#
ClamAV (optional)
#
Kerberos (optional)
#
libical >= 0.48 (optional; for the Cyrus httpd service)
#
libxml 2.x (optional; for the Cyrus httpd service)
# If using the "sql" backend for cyrusdb:
#
MySQL or MariaDB (optional; --with-mysql)
#
PostgreSQL (optional; --with-pgsql)
#
SQLite (optional; --with-sqlite)
#
Net-SNMP >= 4.2 (optional)
#
OpenLDAP (optional; --with-ldap)
#
Perl >= 5.x (optional; --with-perl; needed for cyradm and some installation scripts)
#
tcp wrappers (optional)
#
transfig (...or the Slackware package in 't')
#
valgrind
#
INN (to export newsgroups with IMAP)
# A MTA:
sendmail or
Postfix
# If you upgrade from one minor Berkeley DB release to another, you may
# need to run 'db_recover /var/imap/db' before starting Cyrus IMAP again.
# FYI, Berkeley DB's use is discouraged and support will be removed from
# 3.x In 2.4.18, the defaults are skiplist or flat for all databases.
# If you're about to upgrade Cyrus, I would highly suggest backing up
# everything. A good idea to shut it down before backing it up if possible.
# Possibly something like this:
su
cd
mkdir -p -m 0700 backup/cyrus/$(date +%Y%m%d)
chown cyrus backup/cyrus/$(date +%Y%m%d)
cd backup/cyrus/$(date +%Y%m%d)
test -d /usr/cyrus &&
tar cJvf usr-cyrus.tar.xz /usr/cyrus
test -d /usr/local/cyrus &&
tar cJvf usr-local-cyrus.tar.xz /usr/local/cyrus
tar cJvf usr-sieve.tar.xz /usr/sieve
tar cJvf var-imap.tar.xz /var/imap
tar cJvf var-spool-imap.tar.xz /var/spool/imap
test -d /usr/cyrus/bin &&
su cyrus -c "/usr/cyrus/bin/ctl_mboxlist -d > mailboxes.db.txt"
test -d /usr/local/cyrus/bin &&
su cyrus -c "/usr/local/cyrus/bin/ctl_mboxlist -d > mailboxes.db.txt"
cp -a /etc/cyrus.conf /etc/imapd.conf .
chown -R cyrus:root .
chmod -R o-rwx .
exit
# Cyrus IMAP 2.4.18 (legacy)
# =================
# Skip down below if you want the latest stable release
#
Release notes for 2.4.18
# Previous revisions of this howto used Berkeley DB 4.1 To upgrade from 4.1
# to 4.2, run /usr/local/BerkeleyDB.4.2/bin/db_recover from /var/imap/db
# before you start Cyrus for the first time after installing or upgrading
# it.
# If you have any trouble downloading it via FTP, it's available via HTTP
# too:
#
http://www.cyrusimap.org/releases/cyrus-imapd-2.4.18.tar.gz
# Get the source
cd
test -f installed/cyrus-imapd-2.4.18.tar.gz &&
mv installed/cyrus-imapd-2.4.18.tar.gz .
test ! -f cyrus-imapd-2.4.18.tar.gz &&
wget ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.4.18.tar.gz
# Verify tarball w/
md5sum:
# (this came from my gpg-verified tarball)
echo "6b5151fbb1619cf1a133f65f55cda619 cyrus-imapd-2.4.18.tar.gz" | md5sum -c
# Verify tarball w/
sha1sum:
# (this also came from my gpg-verified tarball)
echo "2a3e449afc235ea72ef3b48ba5c0f66eb199faf2 cyrus-imapd-2.4.18.tar.gz" | sha1sum -c
# Verify tarball w/
gpg:
# Could not find this PGP key on 4 different keyservers as this is written
( gpg --list-keys B36378E0 > /dev/null 2>&1 || gpg --recv-keys B36378E0 ) &&
wget ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.4.18.tar.gz.sig &&
gpg --verify cyrus-imapd-2.4.18.tar.gz.sig &&
rm cyrus-imapd-2.4.18.tar.gz.sig
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cyrus-imapd-*" -exec rm -r {} \;
tar xzvf ~/cyrus-imapd-2.4.18.tar.gz
cd cyrus-imapd-2.4.18
test $UID = 0 && chown -R root:root .
# Before you actually install it, make sure you read (at least) this:
# lynx ~/src/cyrus-imapd-2.4.18/doc/install.html
# On another machine running an older Slackware where most of the packages
# have been replaced with source, I had to put "LIBS=-lpthread" before
# configure to build my copy against my Berkeley DB 4.2
# (--with-dbdir=/usr/local/BerkeleyDB.4.2), otherwise it would fail to
# build against that version and would build against the next version down
# (3.3 at the time).
# If your OpenSSL came with Slackware, or is otherwise not installed
# under /usr/local/ssl, leave off anything below specifying /usr/local/ssl
# If you have NetSNMP installed but do not want to compile-in support for
# it, use --without-snmp
# See the documentation under ./doc/ and the output of
# './configure --help' for other configure flags
## If you are on a 64-bit system and use OpenSSL from source, you will
## probably need to tell things where to find /usr/local/ssl/lib64 manually
#
## This is the 64-bit /usr/local/ssl-installed configure line that I
## typically use:
#LDFLAGS=-L/usr/local/ssl/lib64 OPENSSL_LIB=-L/usr/local/ssl/lib64 #./configure --mandir=/usr/local/man --with-openssl=/usr/local/ssl #--without-snmp
#
## and then:
# make depend
#
## and then:
# make all CFLAGS="-O2 -fPIC" LDFLAGS="-s -L/usr/local/ssl/lib64" # OPENSSL_LIB=-L/usr/local/ssl/lib64
# Configure the build, build it
./configure --mandir=/usr/local/man --with-openssl=/usr/local/ssl
make depend
make all CFLAGS=-O2 LDFLAGS="-s -L/usr/local/ssl/lib"
# Become root to install it
su
# The Perl bits may put man pages in /usr/local/share/man/, instead of
# whatever configure told it to do, so if that does not exist, create a
# symlink to /usr/local/man/ so 'man' can find the man pages in there.
# ...or update MANPATH in /etc/profile or your non-root user's
# ~/.bash_login
test -d /usr/local/man && test ! -e /usr/local/share/man &&
ln -s /usr/local/man /usr/local/share/man
# If your Perl does not use /usr/local/lib/perl5, create a symlink there
# so it will know about Cyrus' modules:
test -d /usr/lib64/perl5 && test ! -e /usr/local/lib64/perl5 &&
ln -sf /usr/lib64/perl5 /usr/local/lib64/perl5
test -d /usr/lib/perl5 && test ! -e /usr/local/lib/perl5 &&
ln -sf /usr/lib/perl5 /usr/local/lib/perl5
# Install it
make install
# If you are upgrading and have fulldirhash enabled in /etc/imapd.conf,
# run tools/rehash:
egrep -q "^fulldirhash: 1$" /etc/imapd.conf &&
su cyrus -c "tools/rehash /etc/imapd.conf"
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/cyrus-imapd-*.tar.*
mv cyrus-imapd-2.4.18.tar.gz installed/
# If this is a new installation, continue with the Configuration section
# below. If not, restart Cyrus and cross your fingers...
# Cyrus IMAP 2.5.12 (stable/current)
# =================
#
Release notes for 2.5.12
# If you have any trouble downloading it via FTP, it's available via HTTP
# too:
#
http://www.cyrusimap.org/releases/cyrus-imapd-2.5.12.tar.gz
# Get the source
cd
test -f installed/cyrus-imapd-2.5.12.tar.gz &&
mv installed/cyrus-imapd-2.5.12.tar.gz .
test ! -f cyrus-imapd-2.5.12.tar.gz &&
wget https://github.com/cyrusimap/cyrus-imapd/releases/download/cyrus-imapd-2.5.12/cyrus-imapd-2.5.12.tar.gz
# Verify tarball w/
sha1sum:
# (this came from my gpg-verified tarball)
echo "6297b8c6454391ca3f0e1467788e6fe2bac148b6 cyrus-imapd-2.5.12.tar.gz" | sha1sum -c
# Verify tarball w/
gpg:
( gpg --list-keys B36378E0 > /dev/null 2>&1 ||
gpg --keyserver pgp.mit.edu --recv-keys B36378E0 ) &&
wget -nc https://github.com/cyrusimap/cyrus-imapd/releases/download/cyrus-imapd-2.5.12/cyrus-imapd-2.5.12.tar.gz.sig &&
gpg --verify cyrus-imapd-2.5.12.tar.gz.sig &&
rm cyrus-imapd-2.5.12.tar.gz.sig
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "cyrus-imapd-*" -exec rm -r {} \;
tar xzvf ~/cyrus-imapd-2.5.12.tar.gz
cd cyrus-imapd-2.5.12
test $UID = 0 && chown -R root:root .
## Before you actually install it, make sure you read (at least) this, and
## there is lots of additional information on the web site.
# lynx ./cyrus-imapd-2.5.12/doc/install.html
# My cyrus-imapd-2.5.9-configure.ac-openssl.patch is no longer needed if you
# have OpenSSL installed under the source default of /usr/local/ssl and
# you are on a 64-bit system using lib64 instead of lib.
# If your OpenSSL is from a distribution package, you probably do not need
# to specify a prefix path with --with-ssl.
# If you have NetSNMP installed but do not want to compile-in support for
# it, use --without-snmp
# --enable-http and --with-sqlite are for the Cyrus httpd service
# See ./doc/install-http.html
#
# I have only compiled, but not implemented this in the past, but with 2.5.12
# I did not even compile it after some ld errors about libical.
# If you do not need IMAP IDLE support via idled, leave off --enable-idled
# See the documentation under ./doc/ and the output of
# './configure --help' for other configure flags
# BIG FAT NOTE:
# One one system, I upgraded from 2.4.x to 2.5.9 and the binaries ended up
# going from /usr/cyrus/bin to /usr/local/cyrus/bin - you may need to update
# that path in your scripts and after verifying all is well with the upgrade,
# you can zap the old one.
# Configure the build
LIB=lib
test $(uname -m) = 'x86_64' && LIB=lib64
./configure --libdir=/usr/local/${LIB} --mandir=/usr/local/man --without-snmp --with-openssl=/usr/local/ssl --with-sqlite --enable-http --enable-idled
unset LIB
# Build it
make all CFLAGS=-O2 LDFLAGS="-s"
# Test the build if you passed --enable-unit-tests to configure (CUnit)
make check
# Become root to install it
su
# The Perl bits may put man pages in /usr/local/share/man/, instead of
# whatever configure told it to do, so if that does not exist, create a
# symlink to /usr/local/man/ so 'man' can find the man pages in there.
# ...or update MANPATH in /etc/profile or your non-root user's
# ~/.bash_login
test -d /usr/local/man && test ! -e /usr/local/share/man &&
ln -s /usr/local/man /usr/local/share/man
# If your Perl does not use /usr/local/lib/perl5, create a symlink there
# so it will know about Cyrus' modules:
test -d /usr/lib64/perl5 && test ! -e /usr/local/lib64/perl5 &&
ln -sf /usr/lib64/perl5 /usr/local/lib64/perl5
test -d /usr/lib/perl5 && test ! -e /usr/local/lib/perl5 &&
ln -sf /usr/lib/perl5 /usr/local/lib/perl5
# Install it
make install
ldconfig
# If you are upgrading and have fulldirhash enabled in /etc/imapd.conf,
# run tools/rehash:
egrep -q "^fulldirhash: 1$" /etc/imapd.conf &&
su cyrus -c "tools/rehash /etc/imapd.conf"
# If this is an upgrade (not a new installation), you should be OK
# to restart Cyrus IMAP now. Cross your fingers:
test -x /etc/rc.d/rc.cyrus && /etc/rc.d/rc.cyrus start
## If you are upgrading from 2.4 to 2.5:
#
# Run this to upgrade index files - it is safe to run while Cyrus IMAP is
# running:
/usr/local/cyrus/bin/reconstruct -V max
#
# Run this to update/check quotas:
/usr/local/cyrus/bin/quota -f
#
# Now look for config file entries that you may need to update, like these:
# autocreatequota -> autocreate_quota
# tls_ca_file -> tls_client_ca_file
# tls_cert_file -> tls_server_cert
# tls_key_file -> tls_server_key
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/cyrus-imapd-*.tar.*
mv cyrus-imapd-2.5.12.tar.gz installed/
# 2.5.x from Git:
# ===============
# Prerequisites:
#
Git
#
autoconf
#
automake
#
libtool
# Get it
mkdir -p -m 0700 ~/src
cd ~/src
test -d ./cyrus-imapd-2.5.x && git pull
test ! -d ./cyrus-imapd-2.5.x &&
git clone -b cyrus-imapd-2.5 --single-branch https://github.com/cyrusimap/cyrus-imapd.git cyrus-imapd-2.5.x
# Generate configure, etc.
cd cyrus-imapd-2.5.x
test $UID = 0 && chown -R root:root .
test -f config.status && make distclean
test ! -f configure && autoreconf -f -i
# Then continue with the 2.5.12 tarball instructions above
# Cyrus IMAP 3.0.1 (stable/current)
# ================
#
Release Notes 3.0.0
#
Release Notes 3.0.1
# If you have any trouble downloading it via FTP, it's available via HTTP
# too:
#
http://www.cyrusimap.org/releases/cyrus-imapd-3.0.1.tar.gz
# Get the source
cd
test -f installed/cyrus-imapd-3.0.1.tar.gz &&
mv installed/cyrus-imapd-3.0.1.tar.gz .
test ! -f cyrus-imapd-3.0.1.tar.gz &&
wget ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-3.0.1.tar.gz
# Verify tarball w/
sha1sum:
# (this came from my gpg-verified tarball)
echo "a8330610a239a1fa16c80d417ac1519f7a9ea146 cyrus-imapd-3.0.1.tar.gz" | sha1sum -c
## Note:
## I tried to retrieve the PGP key as I have done in the past, but every
## keyserver that I tried as I wrote this was either not functioning or
## did not have the key.
## ...so, the sha1sum above only proves that your tarball is the same as
## mine, not that it is the same as the development team's.
# Verify tarball w/
gpg:
# Could not find this PGP key on several different keyservers
( gpg --list-keys B36378E0 > /dev/null 2>&1 ||
gpg --keyserver pgp.mit.edu --recv-keys B36378E0 ) &&
wget -nc ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-3.0.1.tar.gz.sig &&
gpg --verify cyrus-imapd-3.0.1.tar.gz.sig &&
rm cyrus-imapd-3.0.1.tar.gz.sig
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cyrus-imapd-*" -exec rm -r {} \;
tar xzvf ~/cyrus-imapd-3.0.1.tar.gz
cd cyrus-imapd-3.0.1
test $UID = 0 && chown -R root:root .
## Before you actually install it, make sure you read (at least) this, and
## there is lots of additional information on the web site.
# lynx ./cyrus-imapd-3.0.1/doc/install.html
# My cyrus-imapd-2.5.9-configure.ac-openssl.patch is no longer needed if you
# have OpenSSL installed under the source default of /usr/local/ssl and
# you are on a 64-bit system using lib64 instead of lib.
# If your OpenSSL is from a distribution package, you probably do not need
# to specify a prefix path with --with-ssl.
# If you have NetSNMP installed but do not want to compile-in support for
# it, use --without-snmp
# --enable-http and --with-sqlite are for the Cyrus httpd service
# See ./doc/install-http.html
#
# I have only compiled, but not implemented this in the past, but with 3.0.1
# I did not even compile it after some ld errors about libical.
# If you do not need IMAP IDLE support via idled, leave off --enable-idled
# See the documentation under ./doc/ and the output of
# './configure --help' for other configure flags
# BIG FAT NOTE:
# One one system, I upgraded from 2.4.x to 2.5.9 and the binaries ended up
# going from /usr/cyrus/bin to /usr/local/cyrus/bin - you may need to update
# that path in your scripts and after verifying all is well with the upgrade,
# you can zap the old one.
# Configure the build
LIB=lib
test $(uname -m) = 'x86_64' && LIB=lib64
./configure --libdir=/usr/local/${LIB} --mandir=/usr/local/man --without-snmp --with-openssl=/usr/local/ssl --with-sqlite --enable-http --enable-idled
unset LIB
# Build it
make
# If the build fails with an error like 'undefined reference to
# clock_gettime', run 'make clean', then run configure again with LIBS=-lrt
# in front of it, then try 'make' again.
# Test the build if you passed --enable-unit-tests to configure (CUnit)
make check
# Become root to install it
su
# The Perl bits may put man pages in /usr/local/share/man/, instead of
# whatever configure told it to do, so if that does not exist, create a
# symlink to /usr/local/man/ so 'man' can find the man pages in there.
# ...or update MANPATH in /etc/profile or your non-root user's
# ~/.bash_login
test -d /usr/local/man && test ! -e /usr/local/share/man &&
ln -s /usr/local/man /usr/local/share/man
# If your Perl does not use /usr/local/lib/perl5, create a symlink there
# so it will know about Cyrus' modules:
test -d /usr/lib64/perl5 && test ! -e /usr/local/lib64/perl5 &&
ln -sf /usr/lib64/perl5 /usr/local/lib64/perl5
test -d /usr/lib/perl5 && test ! -e /usr/local/lib/perl5 &&
ln -sf /usr/lib/perl5 /usr/local/lib/perl5
# Install it
make install
ldconfig
# If you are upgrading and have fulldirhash enabled in /etc/imapd.conf,
# run tools/rehash:
egrep -q "^fulldirhash: 1$" /etc/imapd.conf &&
su cyrus -c "tools/rehash /etc/imapd.conf"
# If this is an upgrade (not a new installation), you should be OK
# to restart Cyrus IMAP now. Cross your fingers:
test -x /etc/rc.d/rc.cyrus && /etc/rc.d/rc.cyrus start
## If you are upgrading from 2.4 to 2.5:
#
# Run this to upgrade index files - it is safe to run while Cyrus IMAP is
# running:
/usr/local/cyrus/bin/reconstruct -V max
#
# Run this to update/check quotas:
/usr/local/cyrus/bin/quota -f
#
# Now look for config file entries that you may need to update, like these:
# autocreatequota -> autocreate_quota
# tls_ca_file -> tls_client_ca_file
# tls_cert_file -> tls_server_cert
# tls_key_file -> tls_server_key
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/cyrus-imapd-*.tar.*
mv cyrus-imapd-3.0.1.tar.gz installed/
# Configuration
# =============
# Become root
# Use -p to keep $USER set
su -p
# Add a cyrus user that is a member of the mail group:
id cyrus > /dev/null 2>&1 ||
useradd -c "Cyrus IMAP" -d /var/imap -g mail -s /bin/bash -r cyrus
## Add these to /etc/services if they're not in there already:
# pop3 110/tcp
# nntp 119/tcp # If you built IMAPd with INN support
# imap 143/tcp
# nntps 563/tcp # If you built IMAPd with INN and OpenSSL support
# imaps 993/tcp # If you built IMAPd with OpenSSL support
# pop3s 995/tcp # If you built IMAPd with OpenSSL support
# kpop 1109/tcp # If you built SASL with Kerberos support
# lmtp 2003/tcp # If you use lmtp over tcp (not a unix socket)
# smmap 2004/tcp # If you use smmapd
# csync 2005/tcp # If you use replication
# mupdate 3905/tcp # If you use mupdate
# sieve 4190/tcp
# fud 4201/udp
# Create a /etc/cyrus.conf
# Read 'man cyrus.conf', look over the samples in master/conf/, and/or check
# out my sample:
( cd /etc
test ! -f cyrus.conf &&
wget http://englanders.us/pub/linux/misc/cyrus.conf )
# Create a /etc/imapd.conf
# Read 'man imapd.conf', and/or check out my sample:
( cd /etc
test ! -f imapd.conf &&
wget http://englanders.us/pub/linux/misc/imapd.conf )
# Create the required directories:
mkdir -p /var/imap /var/spool/imap /usr/sieve
chown cyrus /var/imap /var/spool/imap /usr/sieve
chgrp mail /var/imap /var/spool/imap /usr/sieve
chmod 750 /var/imap /var/spool/imap /usr/sieve
# Make sure you're still in ~nonrootuser/src/cyrus-imapd-* when you run
# this part
cd $(eval echo ~$USER)/src/cyrus-imapd-*
# As the cyrus user, create the Cyrus directory structure
su cyrus
tools/mkimap
tools/rehash /etc/imapd.conf
exit
# Make sure these directories have correct ownership & permissions:
chown cyrus:mail /var/imap/db /var/imap/socket
chmod 750 /var/imap/db /var/imap/socket
# If the filesystem is ext2 (not ext3, ext4, reiserfs, xfs, jfs, ...):
cd /var/imap
mkdir -p /var/spool/mqueue
chattr +S . user quota user/* quota/*
chattr +S /var/spool/imap /var/spool/imap/* /var/spool/mqueue
# To create SSL/TLS certs for Cyrus, become yourself again (run 'exit'), go
# to the bottom of the
OpenSSL howto to create SSL certs, then come back here
# and become root again (run 'su')
#
# While su'd to root, cd in to your non-root user home directory and put
# them in place:
cd $(egrep "^$(logname):" /etc/passwd | awk -F: '{ print $6 }')
cp demoCA/cacert.pem /var/imap/CAcert.pem
cp newcert.pem /var/imap/cert.pem
cp newkey.pem /var/imap/key.pem
chown cyrus:mail /var/imap/*.pem
chmod 640 /var/imap/*.pem
## If you're using sendmail, add these to the bottom of your sendmail.mc to
## make sendmail use cyrus as your local mailer:
# MAILER(cyrusv2)dnl
# define(`confLOCAL_MAILER', `cyrusv2')dnl
# If you need a startup script, try this sample. Make sure you start cyrus
# before sendmail.
cd /etc/rc.d
test -f rc.cyrus && ( mv -f rc.cyrus rc.cyrus.old ; chmod 600 rc.cyrus.old )
wget http://englanders.us/pub/linux/misc/rc.cyrus && chmod 755 rc.cyrus
test -f rc.cyrus.old && diff -q rc.cyrus.old rc.cyrus && rm rc.cyrus.old
## To have syslog log info from cyrus to /var/log/cyrus, add this line to
## /etc/syslog.conf and HUP syslogd:
# local6.debug /usr/log/cyrus
#
## To have
syslog-ng log info crom cyrus to /var/log/cyrus, add these lines
## to your syslog-ng.conf and HUP syslog-ng:
# filter cyrus { facility(local6) and level(debug); };
# destination cyrus { file("/var/log/cyrus"); };
# log { source(local); filter(cyrus); destination(cyrus); };
## If you built in libwrap (tcp wrappers) support and want to restrict
## access to Cyrus with /etc/hosts.allow and /etc/hosts.deny, use service
## names 'imap', 'pop', and 'sieve'. See 'man 5 hosts_access' for more info
## about those files. Here's an example hosts.deny:
# imap: PARANOID, bad.evil.server.org, 1.2.3.4/255.255.255.0
# If you have a bad user that you want to deny, see 'man cyr_deny'
# (>= 2.5.x)
# If you want to maintain Sieve scripts from a web GUI, try these:
#
Roundcube (a webmail with Sieve support)
#
SmartSieve
#
Squirrelmail (a webmail with a Sieve plugin)
#
Websieve
#
clients - Sieve.Info
# There is lots of info in the doc subdirectory under the source tree.
# Read through doc/install-perf.html for performance hints, read
# doc/install-virtdomains.html for info about setting up Cyrus for
# virtual domains, etc.
# To clean up old files that were left behind after an upgrade, if you
# didn't do the uninstall part at the bottom, look in these directories for
# files that have a date that doesn't match the rest:
# /usr/cyrus/bin
# /usr/local/include/cyrus
## If you have any Berkeley-DB format database files, you can run something
## like this from a cron job to remove old, unused log files:
# test -d /var/imap/db -a -x /usr/bin/db_archive &&
# /usr/bin/db_archive -d -h /var/imap/db
## If you want telemetry logging for a user who logs in with username foo,
## create a directory like so, writable by the user that runs Cyrus IMAP.
## As soon as the user opens a new connection a file with detailed logging
## info will appear. The file name will be something like imap-1234 where
## 1234 is the PID of the imapd process that is handling them. To stop it,
## remove the directory. If you want time stamps in these logs, add
## "logtimestamps: 1" (without the quotes) to /etc/imapd.conf and restart.
##
https://cyrusimap.org/imap/faqs/o-telemetry.html
# mkdir /var/imap/log/foo
# chown cyrus /var/imap/log/foo
# chmod 700 /var/imap/log/foo
# If you ever want to uninstall Cyrus IMAP, this should do it.
#
# You should definitely back up everything first just in case, 'make
# uninstall' (as root) may be enough, the rest is just in case you have old
# files from previous versions.
cd
su
test -x /etc/rc.d/rc.cyrus && /etc/rc.d/rc.cyrus stop
sleep 3
killall $(find /usr/cyrus/bin -type f -exec basename {} \; | grep -v master)
sleep 3
test -d src/cyrus-imapd-* && ( cd src/cyrus-imapd-* ; make uninstall )
test -d /usr/cyrus && rm -r /usr/cyrus
for pfx in /usr /usr/local;
do
( cd ${pfx}/bin
rm -f imtest installsieve sieveshell
test -L pop3test && rm pop3test
test -L nntptest && rm nntptest
test -L lmtptest && rm lmtptest
test -L smtptest && rm smtptest
test -L mupdatetest && rm mupdatetest
test -L sivtest && rm sivtest
test -L synctest && synctest )
test -d ${pfx}/include/cyrus && rm -r ${pfx}/include/cyrus
( cd ${pfx}/lib
rm -f libcyrus.* libcyrus_min.* libcyrus_imap.* libcyrus_sieve.* )
test -d ${pfx}/lib/pkgconfig &&
( cd ${pfx}/lib/pkgconfig
rm -f libcyrus.pc libcyrus_min.pc libcyrus_sieve.pc )
libcyrus_min.pc libcyrus.pc libcyrus_sieve.pc
test -d ${pfx}/lib64 &&
( cd ${pfx}/lib64
rm -f libcyrus.* libcyrus_min.* libcyrus_imap.* libcyrus_sieve.*
test -d ${pfx}/lib64/pkgconfig &&
( cd ${pfx}/lib64/pkgconfig
rm -f libcyrus.pc libcyrus_min.pc libcyrus_sieve.pc )
find ${pfx}/lib/perl5/site_perl -type d -name Cyrus -exec rm -r {} \;
for mandir in ${pfx}/man ${pfx}/share/man;
do
( cd ${mandir}/man1
rm -f imtest.1 installsieve.1 lmtptest.1 mupdatetest.1 nntptest.1 pop3test.1 sieveshell.1 sivtest.1 smtptest.1 )
( cd ${mandir}/man3 ; rm -f Cyrus::*.3 imclient.3 )
( cd ${mandir}/man5
rm -f cyrus.conf.5 imapd.conf.5 krb.equiv.5 )
( cd ${mandir}/man8
rm -f arbitron.8 chk_cyrus.8 ctl_cyrusdb.8 ctl_deliver.8 ctl_mboxlist.8 cvt_cyrusdb.8 cyr_dbtool.8 cyr_deny.8 cyr_df.8 cyr_expire.8 cyr_info.8 cyr_synclog.8 deliver.8 fetchnews.8 fud.8 idled.8 imapd.8 ipurge.8 lmtpd.8 make_md5.8 make_sha1.8 master.8 mbexamine.8 mbpath.8 nntpd.8 notifyd.8 pop3d.8 quota.8 reconstruct.8 rmnews.8 smmapd.8 squatter.8 sync_client.8 sync_reset.8 sync_server.8 syncnews.8 timsieved.8 tls_prune.8 unexpunge.8 )
done
done
test -f /etc/rc.d/rc.cyrus && rm /etc/rc.d/rc.cyrus
exit
find ~/src -maxdepth 1 -type d -name "cyrus-imapd-*" -exec rm -r {} \;
rm -f ~/installed/cyrus-imapd-*.tar.*