# Cyrus IMAP 3.6.5 (GitHub release date: 2024-06-04)
# ================
# Below is the latest 3.6 release. As this is written, the latest release is
# 3.8.x Installation and configuration between major release branches can
# vary greatly, so we cover each one separately. Go to the main
# Cyrus IMAP HOWTO to see other covered
# major releases: 3.4, 3.8, etc.
# This HOWTO is an example of installing or upgrading Cyrus IMAP to be
# configured a particular way. There are MANY different ways to set it up.
# If you are upgrading from an older version, see the following under the
# source (viewable with lynx, links, etc):
# doc/html/imap/download/upgrade.html
# or
# https://www.cyrusimap.org/3.6/imap/download/upgrade.html
# and release notes for the one you're upgrading to.
# Cyrus IMAP 3.6.x does include "Preliminary" support for building with
# OpenSSL 3". OpenSSL 1.1.1 is no longer supported (by OpenSSL) as of
# 2023-09-11, so as this is written, OpenSSL 3.0 or 3.1 is your best bet (if it
# works).
# Cyrus IMAP supports LDAP Authentication, but is a bit light on the
# documentation for that so far:
# OpenLDAP
# Cyrus IMAP 3.6 LDAP Authentication
# Cyrus IMAP 3.6 Authentication and Authorization
# imapd.conf (look for ldap_*, ptsmodule, username_tolower, unix_group_enable options)
#
# You could also set up Cyrus SASL to use LDAP and then Cyrus IMAP would
# not need to know about LDAP directly at all
# There is lots of info in the doc subdirectory under the source tree.
# Read through:
# doc/html/imap/concepts/deployment/performance_recommendations.html
# doc/html/imap/concepts/features/virtual-domains.html
# for info about setting up Cyrus for virtual domains, etc.
# Once you extract the source below, you can view documentation in here:
# ~/src/cyrus-imapd-3.6.5/doc/html/imap/
## I use paths /usr/sieve, /var/imap, /var/spool/imap due to historical
## reasons only. When I first installed Cyrus IMAP, those were the example
## paths given at the time. Nowadays you can use whatever paths you like
## via /etc/imapd.conf configuration options:
#
# defaultpartition: default
# partition-default: /var/spool/imap
# sievedir: /usr/sieve
# configdirectory: /var/imap
#
## You might see in examples: /var/spool/cyrus/mail, /var/spool/sieve,
## /var/lib/cyrus, lockpaths and sockets under /run/cyrus, ...
##
## You can use /this/does/not/matter/in/the/grand/scheme/of/things
## or /its/my/server/and/Ill/use/long/paths/if/I/want/to
## if you really want to.
##
## [ the 'correct' path can be a bit of a "religious debate" like politics,
## abortion, Vim vs Emacs, space vs tab indentation, ...religion... ]
# If you're about to upgrade Cyrus IMAP, I would highly suggest backing up
# everything. If you back up with tarballs and have lots of e-mails with
# lots of attachments, the files could end up being massive, and could take
# a long time to compress everything.
#
# You don't want partial files in a backup, and you will need to (re-)start
# Cyrus IMAP after the upgrade is complete anyway, so best to do this while
# it is not running.
#
# Possibly something like this below to back it up. Ideally you would want
# to be running rsync to copy the files off site periodically or using some
# other backup procedure.
# [ see also: Cyrus IMAP's own experimental replication and backup features ]
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)
tar cJvf usr-sieve.tar.xz /usr/sieve/*
tar cJv --exclude xapian -f var-imap.tar.xz /var/imap/*
tar cJvf var-spool-imap.tar.xz /var/spool/imap/*
test -x /usr/local/sbin/ctl_mboxlist &&
su cyrus -c "/usr/local/sbin/ctl_mboxlist -d > mailboxes.db.txt"
cp -a /etc/cyrus.conf /etc/imapd.conf .
chown -R cyrus:root .
chmod -R o-rwx .
exit
# Prerequisites:
# gawk, grep, sed, binutils, coreutils, gcc, ...
# If you run autoreconf:
# autoconf
# automake
# libtool
# pkg-config
# Database support (no longer includes BDB) - for cyrusdb tables or authentication:
# MySQL or MariaDB (optional)
# PostgreSQL (optional)
# SQLite (optional; needed for Sieve)
# LMDB (optional)
# Caringo object storage (optional)
# OpenIO object storage (optional)
# bison
# flex
# PCRE 8.x or PCRE 2
# ClamAV (optional; for cyr_virusscan)
# OpenSSL
# RSAREF
# Zephyr (optional; for notifyd event notifications as a zephyrgram)
# libcap (POSIX capabilities)
# Jansson >= 2.3 (optional; for the Cyrus httpd service)
# A modern syslog such as syslog-ng or sysklogd or rsyslog (links below)
# Kerberos (optional)
# Cyrus SASL
# Perl
# tcp wrappers' libwrap (optional)
# Search engine (optional):
# Xapian
# (if you need Chinese/Japanese/Korean character support, you'll need
# cyruslibs
# pre-patched Xapian; Xapian requires rsync)
# cld2 (optional; for Xapian)
# icu-uc
# CUnit (optional; for 'make check')
# libsrs2 (optional; for --enable-srs)
# zeroskip (optional)
# CalDAV, CardDAV, JMAP (httpd):
# libxml 2.x (optional; for HTTP)
# libical >= 2.1 (optional; for HTTP)
# nghttp2 >= 1.5
# libbrotli brotlienc
# shapelib >= 1.3.0 (for tzdist geolocation support)
# Wslay (optional; for HTTP/JMAP)
# libchardet (optional; for HTTP/JMAP)
# zlib
# NOTE: The Cyrus binaries in older releases would end up in /usr/cyrus/bin or
# /usr/local/cyrus/bin and this time you may find programs run by 'master' in
# /usr/local/libexec and the rest in /usr/local/bin or sbin.
# You can use 'make install-binsymlinks' after the regular 'make install' below
# if you want to create symlinks from the libexec paths to /usr/local/bin
# and sbin. Run 'make -n install-binsymlinks' to see what it would do, without
# actually doing it.
# Become root (or whatever user you normally do it as) before running
# configure to install some Python and Perl things:
su
# Install/upgrade some Perl modules
perl -MCPAN -e shell
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install CPAN
reload CPAN
install Pod::POM::View::Restructured
install Term::ReadLine
exit
# If you will be using Sphinx, install/upgrade with Python's pip:
# (https://pip.pypa.io/warnings/venv)
python3 -m pip install -U pip
pip install -U docutils
pip install -U Sphinx
# Get the Cyrus IMAP source
cd
test -f installed/cyrus-imapd-3.6.5.tar.gz &&
mv installed/cyrus-imapd-3.6.5.tar.gz .
test ! -f cyrus-imapd-3.6.5.tar.gz &&
wget https://github.com/cyrusimap/cyrus-imapd/releases/download/\
cyrus-imapd-3.6.5/cyrus-imapd-3.6.5.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "c807d6c566a8ff0986a5162eaa3077d57bb78e313d826e27140b5def3f7ac0\
b1 cyrus-imapd-3.6.5.tar.gz" | sha256sum -c
# 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.6.5.tar.gz
cd cyrus-imapd-3.6.5
test $UID = 0 && chown -R root:root .
# Previous major versions had binaries in /usr/cyrus or
# /usr/local/cyrus. These instructions assume this is a new
# installation, or that you have updated paths already when previously
# upgrading from 2.5.x to 3.0.x (and then 3.0 to 3.2, 3.2 to 3.4,
# 3.4 to 3.6, ...).
# If your OpenSSL is from a distribution package, or is OpenSSL >= 1.1.0
# which uses /usr/local as the default prefix, you probably do not need
# to specify a prefix path with --with-ssl. If you have < 1.1.0, then
# --with-ssl=/usr/local/ssl may be needed.
# If you do not need IMAP IDLE support via idled, leave off --enable-idled
# If you want to try the experimental support for Cyrus Backups:
# https://www.cyrusimap.org/3.6/imap/reference/admin/backups.html">Cyrus Backups
# I had a Sphinx build related error, possibly due to the developers' having
# to use an old version for the time being, so I ended up using
# --with-sphinx-build=no be able to build Cyrus IMAP 3.0.18 and 3.2.11 and
# 3.4.5, then 3.6.3 was OK, and 3.6.5 was not. There are some Github issues
# online that may help to point the way, if you have that problem and need
# that support enabled:
# https://github.com/cyrusimap/cyrus-imapd/issues/4491
# For the Cyrus httpd service, CalDAV, CardDAV, WebDAV calendaring,
# contacts, file storage, RSS, JMAP, ... see configure options:
# --enable-http --with-sqlite --enable-calalarmd --enable-jmap
#
# See doc/html/imap/download/installation/http/* and/or the JMAP links above
# Cyrus IMAP 3.6 Installing Cyrus - HTTP modules
# If you have PCRE and PCRE2, and want to use PCRE2, add --disable-pcre
# See the documentation online and/or under ./doc/ and the output of
# './configure --help' for other configure flags
## If you want to build-in support for Xapian, OpenSSL, HTTP, CalDAV,
## CardDAV, JMAP, LDAP auth, SQLite, MySQL/MariaDB, autocreate, replication,
## etc. - most things, here's an example:
# ./configure --libdir=/usr/local/lib64 --mandir=/usr/local/man \
# --sysconfdir=/etc --enable-xapian --enable-srs --enable-autocreate \
# --enable-idled --with-openssl --enable-http --with-sqlite \
# --enable-calalarmd --enable-jmap --with-ldap --with-mysql \
# --enable-replication --disable-pcre --with-sphinx-build=no
#
## If you want a leaner, meaner Cyrus IMAP, smaller and with less features,
## don't need CardDAV, CalDAV, JMAP, MySQL/MariaDB, LDAP, SRS, etc. this one
## below may work better for you
# Reminder (also above), if you have a build failure related to Sphinx,
# re-run configure with --with-sphinx-build=no
# And then read the docs online instead:
# Docs v3.6.x
# 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. This happened a long time ago,
# not sure when or which version...
# Check the build (CUnit tests)
make check
# Become root
# Use -p to keep $USER set
su -p
## Install it
# If this is an upgrade, and you're able, it would be best if you
# could shut it down at this point. If you're not able, you may
# want to wait to run 'make install ; ldconfig' until later after
# doing all of the prep-work.
make install
ldconfig
# 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 NNTP support
# imap 143/tcp
# imsp 406/tcp
# nntps 563/tcp # If you built IMAPd with NNTP and OpenSSL support
# imaps 993/tcp # If you will be using IMAP + SSL
# pop3s 995/tcp # If you will be using POP3 + SSL
# kpop 1109/tcp # If you built SASL with Kerberos support
# lmtp 2003/tcp # If you use LMTP via TCP (not /var/imap/socket/lmtp)
# smmap 2004/tcp # If you use smmapd
# csync 2005/tcp # If you use replication/backups
# mupdate 3905/tcp # If you use murder/mupdate
# sieve 4190/tcp # Server side mail filtering
# fud 4201/udp # If you will be using fud (see 'man fud')
# Create a /etc/cyrus.conf
# Read 'man cyrus.conf', look over the samples in doc/examples/cyrus_conf/*,
# and/or check out my sample (which may be super-outdated):
( cd /etc
test ! -f cyrus.conf &&
wget https://englanders.us/pub/linux/misc/cyrus.conf )
# Read 'man imapd.conf', look over the samples in doc/examples/imapd_conf/*,
# and/or check out my sample (which may be super-outdated):
( cd /etc
test ! -f imapd.conf &&
wget https://englanders.us/pub/linux/misc/imapd.conf )
# Create the required directories - if you don't use these paths, adjust
# accordingly...
# imapd.conf: configdirectory, partition-default, sievedir
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 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, ...):
# [ this is an OLD tip, don't use ext2... ]
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
# Create this if you'll be using Xapian for search:
# (see above)
mkdir -p -m 0750 /var/imap/search
chown cyrus:mail /var/imap/search
chmod 750 /var/imap/search
# Make sure you're still in ~nonrootuser/src/cyrus-imapd-* when you run
# this part
# (if you did not run 'su -p' above, $USER will not be set or would be
# root with 'su -' or sudo - can run 'logname' also...)
cd $(eval echo ~$USER)/src/cyrus-imapd-*
# If this is your first installation, as the cyrus user,
# create the Cyrus directory structure ('su cyrus' assumes your shell is
# something real, i.e. not /bin/false)
su cyrus
tools/mkimap
tools/rehash /etc/imapd.conf
exit
# If you are upgrading and have fulldirhash enabled in /etc/imapd.conf,
# and need to rehash the mail spool, run tools/rehash:
egrep -q "^fulldirhash: 1$" /etc/imapd.conf &&
su cyrus -c "tools/rehash /etc/imapd.conf"
# If you are enabling unixhierarchysep and altnamespace, which now default
# to on, see 'man translatesieve'. It can automatically update Sieve
# scripts.
## To use existing Let's Encrypt certificates:
##
## Copy certificate files in place (you can automate this with certbot's
## --deploy-hook option):
# cd /etc/letsencrypt/live/imap.example.com
# cp fullchain.pem /var/imap/cert.pem
# cp privkey.pem /var/imap/key.pem
# chown cyrus:mail /var/imap/cert.pem /var/imap/key.pem
# chmod 640 /var/imap/cert.pem /var/imap/key.pem
# You can also use CAcert certificates cacert.org, though
# those are only going to be seen as valid on the other end
# if the remote server has the CAcert CA certificate
## 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')
## If you create them yourself, they will be self-signed and
## not seen as valid on the other end if verification is done
## and they do not have your CA certificate
##
## 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
## For sendmail setup details:
## Cyrus IMAP 3.6 Installing Cyrus (the "Integration with Sendmail" section)
#
## If you don't need to support Cyrus IMAP virtual mailboxes, you can use the
## simpler setup of adding these to your sendmail.mc
# MAILER(cyrusv2)dnl
# define(`confLOCAL_MAILER', `cyrusv2')dnl
## Any domain with non-domain mailboxes in Cyrus IMAP would need to be added
## to mailertable like so:
# example.com cyrusv2:/var/imap/socket/lmtp
## and then virtusertable would take care of getting it to the correct
## alias or user:
# me@example.com me
# 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 https://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
## Cyrus IMAP 3.6 The syslog facility
## sysklogd (Slackware's default)
## syslog-ng
## rsyslog
##
## To have syslog log a lot of info (debug) from cyrus to /var/log/cyrus,
## while using a typical syslogd, add this line to /etc/syslog.conf and HUP
## syslogd:
# local6.debug /var/log/cyrus
#
## To have syslog-ng log info from Cyrus IMAP to /var/log/cyrus, add
## something like these lines to your syslog-ng.conf and send it a HUP to
## reload configuration, or restart it.
# filter cyrus { facility(local6); };
# destination cyrus { file("/var/log/cyrus"); };
# log { source(local); filter(cyrus); destination(cyrus); };
#
## And then don't forget to handle log rotation, which may or may not
## involve updating an existing /etc/logrotate.d/syslog file or creating a
## a new one named /etc/logrotate.d/cyrus
## (https://github.com/logrotate/logrotate)
## 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 will be using Xapian for searching, see Xapian links above
#
## Create a directory for it such as:
# mkdir -p -m 0750 /var/imap/search
# chown cyrus:mail /var/imap/search
#
## Add something like these to /etc/imapd.conf (assumes "defaultpartition:
## default"), and you may want/need "search_fuzzy_always: 1" also, maybe
## possibly:
# conversations: 1
# sync_log: on
# sync_log_channels: squatter
# search_engine: xapian
# search_index_headers: 0
# defaultsearchtier: t1
# t1searchpartition-default: /var/imap/search
#
## Add this to /etc/cyrus.conf in the DAEMON section:
# squatter cmd="squatter -R"
#
## Run this once as your cyrus user to index everything
# su cyrus -c "nice -n 20 /usr/local/sbin/squatter -d"
#
## After you're running 3.6 and imapd.conf search_engine is set to xapian,
## you can remove all old cyrus.squat files:
# find /var/spool/imap/ -type f -name cyrus.squat -exec rm {} \;
# If this is an upgrade and Sieve script automatic bytecode compiling
# magic will be happening, make sure a user's Sieve script is
# readable by the cyrus user, and that the compiled bytecode
# version is writable by the cyrus user
# See imapd.conf autocreate_sieve_script* options
# 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
# Make sure /usr/local/sbin is in the cyrus user's PATH (that's where
# cyr_info is), or use the full path where cyr_info is run below
# Check your imapd.conf for deprecated/removed/unrecognized options
# (no output is a good thing)
su cyrus -c "/usr/local/sbin/cyr_info conf-lint \
-C /etc/imapd.conf -M /etc/cyrus.conf"
# If this is an upgrade (not a new installation), and you have confirmed
# all is good with configuration and everything, you should be OK
# to (re-)start Cyrus IMAP now. Cross your fingers:
test -x /etc/rc.d/rc.cyrus && /etc/rc.d/rc.cyrus start
## If you are upgrading from 3.4 to 3.6:
#
# Run this to upgrade index files - it is safe to run while Cyrus IMAP is
# running:
su cyrus -c "/usr/local/sbin/reconstruct -V max"
#
# Run this to update/check quotas:
su cyrus -c "/usr/local/sbin/quota -f"
# If you added/changed "conversations: 1" in /etc/imapd.conf (for JMAP
# and Xapian searching - add -v if you want output):
su cyrus -c "/usr/local/sbin/ctl_conversationsdb -b -r"
# If you have existing CalDAV/CardDAV DBs from older releases, reconstruct:
su cyrus -c "/usr/local/sbin/dav_reconstruct -a"
# List all 3.6 configuration options with () showing which have changed
# since 3.4
su cyrus -c "/usr/local/sbin/cyr_info conf-all \
-s 3.4 -C /etc/imapd.conf -M /etc/cyrus.conf"
# List all configuration options that are different from the default
su cyrus -c "/usr/local/sbin/cyr_info conf \
-C /etc/imapd.conf -M /etc/cyrus.conf"
# List all default configuration options
su cyrus -c "/usr/local/sbin/cyr_info conf-default \
-C /etc/imapd.conf -M /etc/cyrus.conf"
# List ALL configuration options, including defaults
su cyrus -c "/usr/local/sbin/cyr_info conf-all \
-C /etc/imapd.conf -M /etc/cyrus.conf"
# Verify that everything new that would be run by 'master' is in
# /usr/local/libexec, note file dates and times, maybe even run
# ldd and make sure that looks good:
# calalarmd fud httpd idled imapd lmtpd master notifyd pop3d promstatsd
# ptloader smmapd sync_server timsieved
# (and symlinks: lmtpproxyd pop3proxyd proxyd)
# Verify that everything new that should be in 'bin' is in
# /usr/local/bin (unless you changed configure's --prefix):
# cyradm imtest installsieve sieveshell
# (and symlinks: httptest lmtptest mupdatetest nntptest pop3test
# sivtest smtptest synctest)
# Verify that everything new that should be in 'sbin' is in
# /usr/local/sbin (unless you changed configure's --prefix):
# arbitron chk_cyrus ctl_conversationsdb ctl_cyrusdb ctl_deliver
# ctl_mboxlist ctl_zoneinfo cvt_cyrusdb cvt_xlist_specialuse cyr_buildinfo
# cyr_cd.sh cyr_dbtool cyr_deny cyr_df cyr_expire cyr_info cyr_ls cyr_pwd
# cyr_sequence cyr_synclog cyr_userseen cyr_virusscan cyrdump
# dav_reconstruct deliver ipurge mbexamine mbpath mbtool ptdump
# ptexpire quota reconstruct relocate_by_id sievec sieved squatter
# sync_client sync_reset tls_prune unexpunge
# 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/cyrus/bin/
# /usr/local/include/cyrus/
# /var/spool/imap/stage./
# ...
## 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
## or HUP the master process.
## Cyrus IMAP 3.6 How to enable telemetry
# mkdir /var/imap/log/foo
# chown cyrus:mail /var/imap/log/foo
# chmod 700 /var/imap/log/foo
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/cyrus-imapd-*.tar.*
mv cyrus-imapd-3.6.5.tar.gz installed/
# 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_imap.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.*