cyrus-imap-3.4 - IMAP/POP3/Sieve server created at Carnegie Mellon University ChangeLog

HOWTO


# Cyrus IMAP 3.4.5 (GitHub release date: 2023-02-12)
# ================
# Below is the latest 3.4 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.0, 3.2, 3.6, etc.

# Cyrus IMAP 3.4.x does NOT support OpenSSL 3.0, so make sure you've got
# nothing newer than 1.1.1 installed if you will be using it.  1.1.1 is an
# LTS release, but even then it will only be supported until 2023-09-11.  If
# you have existing mailboxes, you may want to consider upgrading Cyrus IMAP
# from 3.4 to 3.6 where you'll be able to run OpenSSL 3.0
#
# (or set up a new server with Cyrus IMAP 3.8, then see if you can
#  bravely + successfully remote copy everything or replicate between them or
#  something else like that...)

# Releases used to be located at ftp.cyrusimap.org, they are now handled at
# GitHub.  If you try to download it as shown below and it is not found,
# look through GitHub Releases:
# https://github.com/cyrusimap/cyrus-imapd/releases

# You can read about new releases on the web site or the cyrus-announce
# mailing list:
# https://www.cyrusimap.org/3.4/imap/support/feedback-mailing-lists.html
#
# The old cyrus-announce mailing list archives are here, they are no longer updated:
# https://lists.andrew.cmu.edu/pipermail/cyrus-announce/
#
# Cyrus IMAP 3.4.5 (and 3.0.18, 3.2.11, and 3.6.1) announcement:
# https://cyrus.topicbox.com/groups/announce/T5b4570423c0e4f6e/cyrus-imap-3-6-1-3-4-5-3-2-11-and-3-0-18-released

# 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 doc/install-upgrade.html and
# release notes for the one you're upgrading to.

# GitHub release cyrus-imapd-3.4.5
#
# Release notes for 3.4.0 through 3.4.5:
# Cyrus IMAP 3.4 Releases
#
# Cyrus IMAP 3.4 documentation
# Some specific sections:
# Cyrus IMAP 3.4 Quickstart Guide
# Cyrus IMAP 3.4 Setup
# - Compiling
# - Installing Cyrus
# - Upgrading to 3.4
# - Configuration Guide
# Cyrus IMAP 3.4 Administrator Guide
# Cyrus IMAP 3.4 Features
# Cyrus IMAP 3.4 Cyrus Sieve
# Cyrus IMAP 3.4 FAQ
# Cyrus IMAP 3.4 Tweaking Cyrus IMAP
# Cyrus IMAP 3.4 Storage Considerations

# If you want to use Sieve scripts, mail filtering, here are some options/info:
# Cyrus IMAP 3.4 timsieved
# Cyrus IMAP 3.4 sieveshell
# Cyrus IMAP 3.4 Sieve
# SmartSieve
# Squirrelmail (a webmail with a Sieve plugin)
# Websieve
# clients - Sieve.Info
# Sieve Language Reference

# If you will be setting up CardDAV, CalDAV (requires Cyrus http):
# Cyrus IMAP 3.4 Checking CardDAV and CalDAV
# Cyrus IMAP 3.4 CardDAV
# Cyrus IMAP 3.4 CalDAV
# imapd.conf (look for caldav_*, calendar_*, carddav_* and httpmodules options)

# If you will be setting up Xapian for searching (--enable-xapian):
# Xapian
# Cyrus IMAP 3.4 Xapian for searching
# imapd.conf (look for jmap_* and httpmodules options)

# JMAP is a regularly changing up-and-coming alternative to IMAP.  Cyrus IMAP
# support will evolve as JMAP standards are defined and updated.  Here are
# various JMAP-related resources:
# jmap.io: JMAP Software Implementations
# Wikipedia: JSON Meta Application Protocol
# Fastmail Blog: We're Making Email More Modern With JMAP
# Cyrus IMAP 3.4 Compiling - CalDAV, CardDAV, JMAP (httpd subsystem)
# Cyrus IMAP 3.4 JMAP support
# Cyrus IMAP 3.4 HTTP modules
# imapd.conf (look for jmap_* and httpmodules options)

# Cyrus IMAP supports monitoring using Prometheus (requires Cyrus http):
# Prometheus
# Cyrus IMAP 3.4 Monitoring

# Cyrus IMAP supports SRS rewriting for mesages that it sends out (--enable-srs):
# libsrs2
# Wikipedia: Sender Rewriting Scheme (SRS)
# imapd.conf (look for srs_* options)

# Cyrus IMAP supports using MySQL/MariaDB for certain databases (--with-mysql):
# MySQL
# MariaDB
# Cyrus IMAP 3.4 Databases
# imapd.conf (look for "_db:" options, and sql_* options)

# Cyrus IMAP supports LDAP Authentication, but is a bit light on the
# documentation for that so far:
# OpenLDAP
# Cyrus IMAP 3.4 LDAP Authentication
# Cyrus IMAP 3.4 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.4.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 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 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


# 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:
#   MySQL or MariaDB (optional)
#   PostgreSQL (optional)
#   SQLite (optional)
#   LMDB (optional)
# Caringo object storage (optional)
# OpenIO object storage (optional)
# bison
# flex
# PCRE 8.x
# 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 rsyslog
# 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 (Slackware has a icu4c package)
# 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:
python3 -m pip install -U pip
pip install -U docutils
pip install -U Sphinx

# GitPython
pip install -U GitPython

# Become your non-root user again
exit


# Get the Cyrus IMAP source
cd
test -f installed/cyrus-imapd-3.4.5.tar.gz &&
mv installed/cyrus-imapd-3.4.5.tar.gz .
test ! -f cyrus-imapd-3.4.5.tar.gz &&
wget https://github.com/cyrusimap/cyrus-imapd/releases/download/\
cyrus-imapd-3.4.5/cyrus-imapd-3.4.5.tar.gz

# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "3a59888a86662f2d57f9de945f90a5d98cca58b4625f07a25fe369a58ddc69\
3a  cyrus-imapd-3.4.5.tar.gz" | sha256sum -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-3.4.5/cyrus-imapd-3.4.5.tar.gz.sig &&
  gpg --verify cyrus-imapd-3.4.5.tar.gz.sig &&
   rm cyrus-imapd-3.4.5.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.4.5.tar.gz
cd cyrus-imapd-3.4.5
test $UID = 0 && chown -R root:root .

# Previous major versions had binaries in /usr/cyrus or
# /usr/local/cyrus.  These instructions assune this is a new
# installation, or that you have updated paths already when previously
# upgrading from 2.5.x to 3.0.x

# 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.4/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 (3.5.4) 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
# There are some issues online that may help to point the way, if you have
# time 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.4 Installing Cyrus - HTTP modules

# 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 \
# --with-sphynx-build=no
#
## If you want a leaner, meaner Cyrus IMAP, smaller and with less features,
## don't need CardDAV, CalDAV, JMAP, MySQL/MariaDB, LDAP, etc. this one
## below may work better for you

# Configure the build
LIB=lib
test $(uname -m) = 'x86_64' && LIB=lib64
./configure --libdir=/usr/local/${LIB} --mandir=/usr/local/man \
--sysconfdir=/etc \
--enable-xapian \
--enable-srs \
--enable-autocreate \
--enable-idled \
--without-sqlite \
--with-openssl
unset LIB

# Build it
make

# 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.4.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

# 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
# imsp      406/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    # 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:
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, ...):
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
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.

### Setting up SSL/TLS in Cyrus IMAP

## Relevant lines in /etc/imapd.conf:
##
# tls_server_ca_dir: /usr/local/ssl/certs
## -or-
# tls_server_ca_dir: /etc/ssl/certs
## -or-
# tls_server_ca_file: /var/imap/abcdefg.pem
## -and-
# tls_server_cert: /var/imap/cert.pem
# tls_server_key: /var/imap/key.pem

## 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

## If you're using sendmail, add these to the bottom of your sendmail.mc to
## make sendmail use Cyrus IMAP 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 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

## 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 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.4 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

# Install it
make install
ldconfig

# Check your imapd.conf for deprecated/removed/unrecognized options
# (no output is a good thing)
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 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.2 to 3.4:
#
# Run this to upgrade index files - it is safe to run while Cyrus IMAP is
# running:
/usr/local/sbin/reconstruct -V max
#
# Run this to update/check quotas:
/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):
/usr/local/sbin/ctl_conversationsdb -b -r

# If you have existing CalDAV/CardDAV DBs from older releases, reconstruct:
/usr/local/sbin/dav_reconstruct -a

# List all 3.4 configuration options with () showing which have changed
# since 3.2
cyr_info conf-all -s 3.2 -C /etc/imapd.conf -M /etc/cyrus.conf

# List all configuration options that are different from the default
cyr_info conf -C /etc/imapd.conf -M /etc/cyrus.conf

# List all default configuration options
cyr_info conf-default -C /etc/imapd.conf -M /etc/cyrus.conf

# List ALL configuration options, including defaults
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:
# fud idled imapd lmtpd master notifyd pop3d smmapd 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 cvt_cyrusdb cvt_xlist_specialuse cyr_buildinfo cyr_dbtool
# cyr_deny cyr_df cyr_expire cyr_info cyr_sequence cyr_synclog cyr_userseen
# cyr_virusscan cyrdump deliver ipurge mbexamine mbpath mbtool quota
# reconstruct sievec sieved squatter 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.4 How to enable telemetry
# mkdir /var/imap/log/foo
# chown cyrus /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.4.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.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2023-09-15 11:10pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]