Blob Blame History Raw
%define scmt(l:) %(c=%1; echo ${c:0:%{-l:%{-l*}}%{!-l:7}})

# Cassandane commit hash.  Cassandane doesn't have releases often, but it
# receives constant development.  This was fetched on 20180518.
%global cocas 00bfe0109f80437ed09154aca9fbd53eef8f1b09

# Cassandane run by default.  '--without cassandane' disables.
%bcond_without cassandane

Name: cyrus-imapd
Version: 3.0.7
Release: 24%{?dist}

%define ssl_pem_file_prefix /etc/pki/%name/%name

# UID/GID 76 have long been reserved for Cyrus
%define uid 76
%define gid 76

%define cyrususer cyrus
%define cyrusgroup mail
%define cyrexecdir %_libexecdir/%name

Summary: A high-performance email, contacts and calendar server
License: BSD
URL: http://www.cyrusimap.org/
Source0: http://www.cyrusimap.org/releases/%name-%version.tar.gz
Source1: CHANGES.rpm

# Adapt a timeout to handle our slower builders
Patch0: patch-cyrus-testsuite-timeout

# Upstream https://github.com/cyrusimap/cyrus-imapd/issues/2026
Patch1: patch-cyrus-managesieve-linking

# Fedora-specific patch for the default configuration file
Patch2: patch-cyrus-default-configs

# vzic uses an old makefile that needs hacks to use the proper flags
Patch3: patch-vzic-proper-cflags

Patch4: cyrus-imapd-close_backup_on_failure.patch
Patch5: cyrus-imapd-memory_leak_on_cleanup.patch
Patch6: cyrus-imapd-memory_leak_on_cleanup_2.patch
Patch7: cyrus-imapd-close_backup_fd_on_error.patch
Patch8: cyrus-imapd-cve_2019_11356.patch
Patch9: cyrus-imapd-CVE-2019-19783.patch
Patch10: cyrus-imapd-CVE-2019-18928.patch
Patch11: cyrus-imapd-use_system_ciphers.patch
Patch12: cyrus-imapd-3.0-CVE-2021-33582.patch
# https://github.com/cyrusimap/cyrus-imapd/pull/3892
Patch13: cyrus-squatter-assert-crash.patch
# https://github.com/cyrusimap/cyrus-imapd/commit/562ac9d7abd3b928315c7f0672d0f1a8995ca625
Patch14: cyrus-imapd-load-tombstones-for-cleanup.patch

Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config
Source12: cyrus-imapd.sysconfig
Source13: cyrus-imapd.cvt_cyrusdb_all
Source14: cyrus-imapd.magic
# XXX A systemd timer would probably be better
Source15: cyrus-imapd.cron-daily
Source16: README.rpm
Source17: cyrus-imapd.service
Source18: cyrus-imapd-init.service
Source19: cyrus-imapd.tmpfiles.conf



# Source files for running the Cassandane test suite at build time.
Source80: https://github.com/cyrusimap/cassandane/archive/%cocas.tar.gz#/cassandane-%{scmt %cocas}.tar.gz

# The CPAN version, and hence the Fedora-packaged version, of Net::CalDAVTalk
# doesn't include the testdata directory.  Cassandane can use it for testing
# calendaring, so it's included here.
# This archive was generated by running:
#   svn export https://github.com/brong/Net-CalDAVTalk/trunk/testdata
#   tar cfz cassandane-testdata-20170523.tar.gz testdata
# Note that this changes very rarely.  See
#   https://github.com/brong/Net-CalDAVTalk/tree/master/testdata
Source81: cassandane-testdata-20170523.tar.gz

# A template config file for cassandane; we will substitute in varions values.
Source82: cassandane.ini

# These are source files and not patches because you can't use autosetup to
# apply patches to secondary unpacked source files.

# Prevent cassandane from trying to syslog things
Source91: patch-cassandane-no-syslog

# Tell the annotator script to run as the current user/group
# Upstream ticket https://github.com/cyrusimap/cyrus-imapd/issues/1995
Source92: patch-cassandane-fix-annotator

Source93: cyrus-imapd-master_rename.patch

BuildRequires: autoconf automake bison flex gcc gcc-c++ git groff libtool
BuildRequires: pkgconfig systemd transfig

BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker)
BuildRequires: perl(Pod::Html)

BuildRequires: CUnit-devel cyrus-sasl-devel glib2-devel
BuildRequires: jansson-devel krb5-devel libical-devel libicu-devel
BuildRequires: libnghttp2-devel libxml2-devel mariadb-devel net-snmp-devel
BuildRequires: openldap-devel openssl-devel postgresql-devel
BuildRequires: sqlite-devel
BuildRequires: xapian-core-devel

# Miscellaneous modules needed for 'make check' to function:
BuildRequires: cyrus-sasl-plain cyrus-sasl-md5

%if %{with cassandane}
# Additional packages required for cassandane to function
BuildRequires: imaptest net-tools words
BuildRequires: perl(AnyEvent) perl(BSD::Resource) perl(Clone)
BuildRequires: perl(experimental) perl(File::chdir) perl(File::Slurp)
BuildRequires: perl(IO::Socket::INET6) perl(Mail::IMAPTalk)
BuildRequires: perl(Config::IniFiles) perl(Mail::JMAPTalk) perl(Math::Int64)
BuildRequires: perl(Net::CalDAVTalk) perl(Net::CardDAVTalk)
BuildRequires: perl(Net::Server) perl(News::NNTPClient) perl(Path::Tiny)
BuildRequires: perl(String::CRC32) perl(Sys::Syslog)
BuildRequires: perl(Test::Unit::TestRunner) perl(Time::HiRes)
BuildRequires: perl(Unix::Syslog) perl(XML::DOM) perl(XML::Generator)

# For tls tests
BuildRequires: sscg

# These were only for JMAP-Tester
# perl(Moo), perl(Moose), perl(MooseX::Role::Parameterized) perl(Throwable), perl(Safe::Isa)
%endif

Requires(pre): shadow-utils
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%{?systemd_requires}

Requires: %name-utils = %version-%release
Recommends: %name-vzic = %version-%release
Requires: file libdb-utils sscg
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: cyrus-imapd = %{version}-%{release}

%{?perl_default_filter}

%description
The Cyrus IMAP (Internet Message Access Protocol) server provides access to
personal mail, system-wide bulletin boards, news-feeds, calendar and contacts
through the IMAP, JMAP, NNTP, CalDAV and CardDAV protocols. The Cyrus IMAP
server is a scalable enterprise groupware system designed for use from small to
large enterprise environments using technologies based on well-established Open
Standards.

A full Cyrus IMAP implementation allows a seamless mail and bulletin board
environment to be set up across one or more nodes. It differs from other IMAP
server implementations in that it is run on sealed nodes, where users are not
normally permitted to log in. The mailbox database is stored in parts of the
filesystem that are private to the Cyrus IMAP system. All user access to mail
is through software using the IMAP, IMAPS, JMAP, POP3, POP3S, KPOP, CalDAV
and/or CardDAV protocols.

The private mailbox database design gives the Cyrus IMAP server large
advantages in efficiency, scalability, and administratability. Multiple
concurrent read/write connections to the same mailbox are permitted. The server
supports access control lists on mailboxes and storage quotas on mailbox
hierarchies.


%package devel
Summary: Cyrus IMAP server development files
Requires: %name%{?_isa} = %version-%release
Requires: pkgconfig

%description devel
The %name-devel package contains header files and libraries
necessary for developing applications which use the imclient library.


%package doc-extra
Summary: Extra documentation for the Cyrus IMAP server
BuildArch: noarch

%description doc-extra
This package contains the HTML documentation for the Cyrus IMAP server, as well
as some legacy and internal documentation not useful for normal operation of
the server.


%package utils
Summary: Cyrus IMAP server administration utilities

%description utils
The cyrus-imapd-utils package contains administrative tools for the
Cyrus IMAP server. It can be installed on systems other than the
one running the server.


%package vzic
Summary: Utilities to convert timezone database files
License: GPLv2+
Requires: %name = %version-%release
# Contains a lightly forked version of vzic.  This seems to have been bundled
# into various other things and it's old, so I'm not sure where the upstream
# is.  Here are a couple of possible upstreams:
# https://github.com/libical/vzic
# https://sourceforge.net/projects/vzic/
# It is probably a good idea to split it out and package it separately, but the
# code here definitely differs from that at the second link above.
Provides: bundled(vzic) = 1.3

%description vzic
vzic is a program to convert the Olson timezone database files into VTIMEZONE
files compatible with the iCalendar specification (RFC2445).

This package contains a forked version of vzic for internal use by the Cyrus
IMAP server.

# Build dir is either $PWD, $(pwd) or %

%prep
%autosetup -p1 -S git
echo %version > VERSION

# Install the Fedora-specific documentation file
install -m 644 %SOURCE1 doc/
install -m 644 %SOURCE16 doc/

# Unpack and prepare cassandane
tar xf %SOURCE80
ln -s cassandane-%cocas cassandane
pushd cassandane
mkdir work
tar xf %SOURCE81

patch -p1 < %SOURCE91
patch -p1 < %SOURCE92
patch -p1 < %SOURCE93

cp %SOURCE82 cassandane.ini
# RF rpm-buildroot-usage
sed -i \
    -e "s!CASSDIR!$(pwd)!" \
    -e "s!BUILDROOT!%buildroot!" \
    cassandane.ini

popd

# Drop expired certificates and generate new ones
pushd cunit
rm -rf *pem
%{_bindir}/sscg --package %{name} --cert-file cert.pem --cert-key-file key.pem --ca-file cacert.pem
popd

## Modify docs master --> cyrus-master
#%{__perl} -pi -e "s@master\(8\)@cyrus-master(8)@" man/*5 man/*8 lib/imapoptions
#sed -i -e 's|\([^-]\)master|\1cyrus-master|g;s|^master|cyrus-master|g;s|Master|Cyrus-master|g;s|MASTER|CYRUS-MASTER|g' \
#        man/master.8 doc/man.html


%build
# This is the test suite, which doesn't build much but does verify its dependencies.
# If this is done after the configure call, the one thing it does build fails
# because the configure macro puts some hardening flags into the environment.
%if %{with cassandane}
pushd cassandane
make
popd
%endif

# Notes about configure options:
# --enable-objectstore
#   It's experimental, and it doesn't appear that either openio or caringo are
#   in Fedora.
# --with-cyrus-prefix and --with-service-path went away; use --with-libexecdir=
# instead.

# Needed because of Patch4.
autoreconf -vi

%configure \
    --disable-silent-rules \
    \
    --libexecdir=%cyrexecdir \
    --with-extraident="%release Fedora" \
    --with-krbimpl=mit \
    --with-ldap=/usr \
    --with-libwrap=no \
    --with-mysql \
    --with-pgsql \
    --with-perl=%__perl \
    --with-snmp \
    --with-syslogfacility=MAIL \
    \
    --enable-autocreate \
    --enable-backup \
    --enable-calalarmd \
    --enable-http \
    --enable-idled \
    --enable-jmap \
    --enable-murder \
    --enable-nntp \
    --enable-replication \
    --enable-unit-tests \
    --enable-xapian \
%if 0%{?fedora} && 0%{?fedora}  >= 0
    --with-clamav \
%endif
#

# The configure script will set up the Perl makefiles, but not in the way
# Fedora needs them.  So regenerate them manually.
for i in perl/annotator perl/imap perl/sieve/managesieve; do
    pushd $i
    rm -f Makefile
    perl Makefile.PL INSTALLDIRS=vendor # NO_PERLOCAL=1 NO_PACKLIST=1
    popd
done

%make_build

# This isn't built by default, but this package has always installed it.
make notifyd/notifytest

# Also not built by default, but the tools are needed for serving timezone info
make -C tools/vzic

# Modify docs master --> cyrus-master
%{__perl} -pi -e "s@master\(8\)@cyrus-master(8)@" man/*5 man/*8 lib/imapoptions
sed -i -e 's|\([^-]\)master|\1cyrus-master|g;s|^master|cyrus-master|g;s|Master|Cyrus-master|g;s|MASTER|CYRUS-MASTER|g' \
	man/master.8 doc/legacy/man.html

%install
make install DESTDIR=%buildroot

# Create directories
install -d \
    %buildroot/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig,cron.daily} \
    %buildroot/%_libdir/sasl \
    %buildroot/var/spool/imap \
    %buildroot/var/lib/imap/{user,quota,proc,log,msg,socket,db,sieve,sync,md5,rpm,backup,meta} \
    %buildroot/var/lib/imap/ptclient \
    %buildroot/%_datadir/%name/rpm \
    %buildroot/%cyrexecdir \
    %buildroot/etc/pki/%name

install -d -m 0750 \
    %buildroot/run/cyrus \
    %buildroot/run/cyrus/socket

install -d -m 0700 \
    %buildroot/run/cyrus/db \
    %buildroot/run/cyrus/lock \
    %buildroot/run/cyrus/proc

# Some tools which aren't installed by the makefile which we have always installed
install -m 755 notifyd/notifytest  %buildroot%_bindir/
install -m 755 perl/imap/cyradm    %buildroot%_bindir/
for i in arbitronsort.pl masssievec mkimap mknewsgroups rehash translatesieve; do
    install -m 755 tools/$i %buildroot/%cyrexecdir/
done

for i in vzic vzic-test.pl vzic-merge.pl vzic-dump.pl; do
    install -m 755 tools/vzic/$i %buildroot/%cyrexecdir/
done

# Install additional files
install -p -m 644 %SOURCE10 %buildroot/etc/logrotate.d/%name
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/pop
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/imap
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/sieve
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/mupdate
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/lmtp
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/nntp
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/csync
install -p -m 644 %SOURCE12 %buildroot/etc/sysconfig/%name
install -p -m 755 %SOURCE13   %buildroot/%cyrexecdir/cvt_cyrusdb_all
install -p -m 644 %SOURCE14   %buildroot/%_datadir/%name/rpm/magic
install -p -m 755 %SOURCE15 %buildroot/etc/cron.daily/%name
install -p -m 644 doc/examples/cyrus_conf/prefork.conf %buildroot/etc/cyrus.conf
install -p -m 644 doc/examples/imapd_conf/normal.conf %buildroot/etc/imapd.conf
install -p -D -m 644 %SOURCE17 %buildroot/%_unitdir/cyrus-imapd.service
install -p -D -m 644 %SOURCE18 %buildroot/%_unitdir/cyrus-imapd-init.service
install -p -D -m 644 %SOURCE19 %buildroot/%_tmpfilesdir/cyrus-imapd.conf

# Rename 'master' binary and manpage to avoid clash with postfix
mv -f %{buildroot}%{cyrexecdir}/master         %{buildroot}%{cyrexecdir}/cyrus-master

# mv -f %{buildroot}%{_mandir}/man8/master.8      %{buildroot}%{_mandir}/man8/cyrus-master.8

# Rename 'fetchnews' binary and manpage to avoid clash with leafnode
#mv -f %{buildroot}%{cyrexecdir}/fetchnews      %{buildroot}%{cyrexecdir}/cyrfetchnews
#mv -f %{buildroot}%{_mandir}/man8/fetchnews.8   %{buildroot}%{_mandir}/man8/cyrfetchnews.8
#%{__perl} -pi -e 's|fetchnews|cyrfetchnews|g;s|Fetchnews|Cyrfetchnews|g;s/FETCHNEWS/CYRFETCHNEWS/g' \
#          %{buildroot}%{_mandir}/man8/cyrfetchnews.8

#remove executable bit from docs
for ddir in doc perl/imap/examples
do
  find $ddir -type f -exec chmod -x {} \;
done


# Cleanup of doc dir
find doc perl -name CVS -type d -prune -exec rm -rf {} \;
find doc perl -name .cvsignore -type f -exec rm -f {} \;
rm -f doc/Makefile.dist*
rm -f doc/text/htmlstrip.c
rm -f doc/text/Makefile
rm -rf doc/man

# fix permissions on perl .so files
find %buildroot/%_libdir/perl5/ -type f -name "*.so" -exec chmod 755 {} \;

# Generate db config file
# XXX Is this still necessary?
( grep '^{' lib/imapoptions | grep _db | cut -d'"' -f 2,4 | \
  sed -e 's/^ *//' -e 's/-nosync//' -e 's/ *$//' -e 's/"/=/'
  echo sieve_version=2.2.3 ) | sort > %buildroot/%_datadir/%name/rpm/db.cfg

# Cyrus has various files with extremely conflicting names.  Some of these are
# not unexpected ("imapd" itself) but some like "httpd" are rather surprising.

# Where there are only conflicting manpages, they have been moved to a "8cyrus"
# section.  If the binary was renamed, then the manpages are renamed to match
# but a internal replacement has not been done.  This may lead to more
# confusion but involves modifying fewer upstream files.

# Actual binary conflicts
# Rename 'fetchnews' binary and manpage to avoid clash with leafnode
mv %buildroot/%_sbindir/fetchnews %buildroot/%_sbindir/cyr_fetchnews
mv %buildroot/%_mandir/man8/fetchnews.8 %buildroot/%_mandir/man8/cyr_fetchnews.8

# Fix conflict with dump
mv %buildroot/%_sbindir/restore %buildroot/%_sbindir/cyr_restore
mv %buildroot/%_mandir/man8/restore.8 %buildroot/%_mandir/man8/cyr_restore.8

# Fix conceptual conflict with quota
mv %buildroot/%_sbindir/quota %buildroot/%_sbindir/cyr_quota
mv %buildroot/%_mandir/man8/quota.8 %buildroot/%_mandir/man8/cyr_quota.8

# fix conflicts with uw-imap
mv %buildroot/%_mandir/man8/imapd.8 %buildroot/%_mandir/man8/imapd.8cyrus
mv %buildroot/%_mandir/man8/pop3d.8 %buildroot/%_mandir/man8/pop3d.8cyrus

# Rename 'master' manpage
mv %buildroot/%_mandir/man8/master.8 %buildroot/%_mandir/man8/master.8cyrus

# Rename 'httpd' manpage to avoid clash with Apache
mv %buildroot/%_mandir/man8/httpd.8 %buildroot/%_mandir/man8/httpd.8cyrus

# Old cyrus packages used to keep some executables in /usr/lib/cyrus-imapd
# RF hardcoded-library-path in %%buildroot/usr/lib/cyrus-imapd
mkdir %buildroot/usr/lib/cyrus-imapd
pushd %buildroot/usr/lib/cyrus-imapd
ln -s ../../sbin/deliver
popd

#remove executable bit from docs
for ddir in doc perl/imap/examples
do
  find $ddir -type f -exec chmod -x {} \;
done

# Remove pointless libtool archives
rm %buildroot/%_libdir/*.la

# Remove installed but not packaged files
rm %buildroot/%cyrexecdir/pop3proxyd
find %buildroot -name "perllocal.pod" -exec rm {} \;
find %buildroot -name ".packlist" -exec rm {} \;


%check
## First of all check if imaptest is functional at all
imaptest  -h 2>&1 > /dev/null || (echo "Imaptest is not functional" && exit 1)
make %{?_smp_mflags} check || exit 1

%ifarch ppc64le %ix86
exit 0
%endif

%if %{without cassandane}
exit 0
%endif

# Run the Cassandane test suite.  This will exhaustively test the various
# server components, but running it in a mock chroot is rather an exercise.
pushd cassandane

mkdir -p imaptest/src
ln -s /usr/bin/imaptest imaptest/src
ln -s /usr/share/imaptest/tests imaptest/src

export LD_LIBRARY_PATH=%buildroot/%_libdir
export CYRUS_USER=$USER

# Construct the set of excluded tests to pass to Cassandane
# ---------------------------------------------------------
exclude+=("!Master.maxforkrate") # Some builders are too slow to complete this test properly
tests=(
    # This is more a test of system performance and according to upstream won't
    # be reliable on shared hardware like our builders.
    Metronome

    # This tests coredumping and won't work on a machine where systemd
    # intercepts coredumps, which includes our builders.
    Cassandane::Test::Core

    # Upstream recommends disabling this because it has an internal race and
    # will fail randomly.  https://github.com/cyrusimap/cassandane/issues/17
    Master.sighup_recycling

    # Fails because our Xapian is too old for proper CJK support.  1.5 will be
    # OK, but it is not yet released.  The alternative is to bundle.
    SearchFuzzy.cjk_words

    # These additionaly fail because Cyrus 3.0.7 no longer enables
    # SNIPPET_EMPTY_WITHOUT_MATCH when the Cyrus-patched Xapian is not in use.
    # https://github.com/cyrusimap/cyrus-imapd/commit/f008060cb53b3286fcedf7b8b4dd12c1980d665f
    SearchFuzzy.normalize_snippets
    SearchFuzzy.snippet_wildcard
    SearchFuzzy.snippets_termcover
    SearchFuzzy.snippets_escapehtml
    SearchFuzzy.stem_verbs

    # As of yet unexplained
    # https://github.com/cyrusimap/cyrus-imapd/issues/2047
    Admin.imap_admins

    # Upstream on IRC indicates that these two are expected to fail on 3.0.
    Carddav.sharing_contactpaths
    Metadata.set_specialuse_twice

    # This one needs a patch to xapian.
    # https://github.com/cyrusimap/cyrus-imapd/issues/2348
    SearchFuzzy.search_subjectsnippet

    # this one is not working on builder machines
    Conversations.xconvfetch
)
for i in ${tests[@]}; do exclude+=("!$i"); done

%if 0%{?fedora} <= 28
# imaptest on F28 has bugs which make some additional tests fail
tests=(
    # Three new failures with imaptest 20170719
    # https://github.com/cyrusimap/cyrus-imapd/issues/2087
    ImapTest.append-binary
    ImapTest.fetch-binary-mime
    ImapTest.urlauth-binary

    # This one seems to fail randomly.
    ImapTest.urlauth2
)
for i in ${tests[@]}; do exclude+=("!$i"); done
%endif

%if 0%{?fedora} <= 26
# Some F26-specific test exclusions
tests=(
    # These all fail because F26 perl doesn't support quad types in unpack.
    Metadata.expunge_messages
    Metadata.msg_replication_new_mas_partial_wwd
    Metadata.msg_replication_new_rep
    Metadata.msg_replication_new_mas
    Metadata.msg_replication_exp_bot
    Metadata.msg_replication_new_mas_partial_wwsw
    Metadata.msg_replication_exp_mas
    Metadata.msg_replication_mod_mas
    Metadata.msg_replication_exp_rep
    Metadata.msg_replication_mod_bot_msl
    Metadata.msg_replication_new_bot_mse_gul
    Metadata.msg_replication_mod_bot_msh
    Metadata.msg_replication_new_bot_mse_guh
    Metadata.msg_replication_mod_rep
)
for i in ${tests[@]}; do exclude+=("!$i"); done
%endif

# Add -vvv for too much output
./testrunner.pl %{?_smp_mflags} -v -f pretty ${exclude[@]} 2>&1


%pre
# Create 'cyrus' user on target host
getent group saslauth >/dev/null || /usr/sbin/groupadd -g %gid -r saslauth
getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /var/lib/imap -g %cyrusgroup \
  -G saslauth -s /sbin/nologin -u %uid -r %cyrususer

%post
/sbin/ldconfig
%systemd_post cyrus-imapd.service

%preun
%systemd_preun cyrus-imapd.service

%postun
/sbin/ldconfig
%systemd_postun_with_restart cyrus-imapd.service


%files
%license COPYING
%doc README.md doc/README.* doc/examples doc/text doc/CHANGES.rpm

%_datadir/cyrus-imapd
%_libdir/libcyrus*.so.*
%_mandir/man5/*
%_mandir/man8/*

%dir /etc/pki/cyrus-imapd
%attr(0644,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix-ca.pem
%attr(0644,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix.pem
%attr(0640,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix-key.pem

%config(noreplace) /etc/cyrus.conf
%config(noreplace) /etc/imapd.conf
%config(noreplace) /etc/logrotate.d/cyrus-imapd
%config(noreplace) /etc/sysconfig/cyrus-imapd
%config(noreplace) /etc/pam.d/*

/etc/cron.daily/cyrus-imapd
%_unitdir/cyrus-imapd.service
%_unitdir/cyrus-imapd-init.service
%_tmpfilesdir/cyrus-imapd.conf

%dir %cyrexecdir/
%cyrexecdir/[a-uw-z]*

# This creates some directories which in the default configuration cyrus will
# never use because they are placed under /run instead.  However, old
# configurations or setup advice from the 'net might reference them, and so
# it's simpler to just leave them in the package.
%attr(0750,%cyrususer,%cyrusgroup) %dir /var/lib/imap/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/backup/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/db/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/log/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/meta/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/md5/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/msg/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/proc/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/ptclient/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/quota/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/rpm/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/sieve/
%attr(0750,%cyrususer,%cyrusgroup) /var/lib/imap/socket
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/sync/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/user/
%attr(0700,%cyrususer,%cyrusgroup) /var/spool/imap/

# The new locations
%attr(0750,%cyrususer,%cyrusgroup) %dir /run/cyrus/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/db/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/lock/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/proc/
%attr(0750,%cyrususer,%cyrusgroup) /run/cyrus/socket/


%files devel
%_includedir/cyrus/
%_libdir/libcyrus*.so
%_libdir/pkgconfig/*.pc
%_mandir/man3/imclient.3*


%files doc-extra
%doc doc/html doc/internal doc/legacy


%files utils
%license COPYING
%doc perl/imap/README
%doc perl/imap/Changes
%doc perl/imap/examples
%{_bindir}/*
%{_sbindir}/*
%{perl_vendorarch}/auto/Cyrus
%{perl_vendorarch}/Cyrus
%{perl_vendorlib}/Cyrus
%{_mandir}/man3/*.3pm*
%{_mandir}/man1/*
# RF hardcoded-library-path in /usr/lib/cyrus-imapd
/usr/lib/cyrus-imapd


%files vzic
%cyrexecdir/vzic*


%changelog
* Mon Jun 13 2022 Martin Osvald <mosvald@redhat.com> - 3.0.7-24
- Resolves: #1911689 - Fatal error when running "squatter -r user"
- Resolves: #1941255 - Wait for network-online target
- Resolves: #1918780 - "(null)" partitions in ctl_mboxlist

* Wed Sep 01 2021 Tomas Korbar <tkorbar@redhat.com> - 3.0.7-23
- Fix CVE-2021-33582
- Also disable unstable test
- Resolves: CVE-2021-33582

* Thu May 27 2021 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-22
- rebuild with xapian support

* Fri Nov  6 2020 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-20
- Use PROFILE=SYSTEM as default configuration for tls_ciphers

* Thu Apr 23 2020 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-19
- change ownership of pki files (#1710722)

* Thu Apr 23 2020 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-18
- Move old changelog into separate file (#1671239)

* Tue Apr 21 2020 Pavel Zhukov <pavel@desktop.zhukoff.net> - 3.0.7-17
- Add fix for CVE-2019-19783
- Add fix for CVE-2019-18928

* Fri Jun  7 2019 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-16
- Resolves: #1718195 - don't overrun buffer when parsing strings with sscanf()

* Mon Oct  8 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-15
- Related: #1602472 - Fix rpmdiff warnings

* Mon Oct  8 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-14
- Related: #1602472 - Fix misused syntax warning

* Tue Oct  2 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-13
- Related: #1602472 - Fix few covscan warnings

* Sun Aug 12 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-12
- Rename master -> cyrus-master in documentation

* Thu Aug  9 2018 Josef Ridky <jridky@redhat.com> - 3.0.7-11
- Rebuild for Net-SNMP

* Wed Aug  8 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-10
- Rename master -> cyrus-master

* Wed Aug  8 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-9
- Load supported modules only

* Mon Aug  6 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-7
- Resolves: №1611713 -  Generate SSl cerificates for starttls test

* Mon Jun 25 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-6
- Drop shapelib in RHEL

* Fri Jun 22 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-5
- Drop xapian support

* Tue May 22 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.0.7-4
- Disable clamav support for non Fedora's
- Disable forktest due to builders slowness

* Fri May 18 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.7-2
- Really enable mysql and clamav support.

* Fri May 18 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.7-1
- Update to 3.0.7.
- Update Cassandane checkout.
- Update excluded Cassandane test list.

* Tue May 01 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.6-1
- Update to 3.0.6.
- Remove upstreamed patches and renumber the rest.
- Disable one new failing test:
  https://github.com/cyrusimap/cyrus-imapd/issues/2332

* Mon Apr 30 2018 Pete Walter <pwalter@fedoraproject.org> - 3.0.5-15
- Rebuild for ICU 61.1

* Tue Apr 17 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-14
- Update Cassandane again, fixing a broken test.

* Fri Apr 13 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-13
- Update Cassandane, fixing a few tests and a class of weird random build
  failures.

* Fri Apr 06 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-12
- Update list of excluded tests.
- Update Cassandane snapshot; use new base_port config setting.  No need to
  patch that in now.
- Add four new expected-to-fail tests from new Cassandane snapshot.
- Add patch to collect extra Cassandane logging in case we hit some of those
  sporadic failures again.

* Tue Apr 03 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-11
- Re-enable imaptest on >= F29.
- F29's imaptest fixes several bugs, allowing all tests to be run there.
- Relocate cassandane base port to hopefully work better in koji.

* Mon Apr 02 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-10
- Update cassandane checkout to fix a test that was broken by DST.
- Add patch to fix sieve scripts for usernames containing a dot.
- Disable imaptest in cassandane until
  https://bugzilla.redhat.com/show_bug.cgi?id=1562970 is fixed.
- Re-enable tests on s390; it seems to be better now.

* Thu Mar 15 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-9
- Re-enable clamav on ppc64.

* Thu Mar 01 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-8
- Bump client_timeout value in test suite.

* Thu Mar 01 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-7
- Add patch to fix imtest (rhbz#1543481).
- Fix vzic makefile to use proper cflags (rhbz#1550543).

* Mon Feb 26 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-6
- Update cassandane checkout.
- Add two new build dependencies.
- Remove all JMAP-related tests from the exclusion lists, since cassandane no
  longer runs any JMAP tests on cyrus 3.0.
- Collapse unused test skip lists.
- Add ten additional skipped tests, after consultation with upstream.

* Mon Feb 26 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-5
- Add patch to fix segfaults in squatter.
- Exclude one test on all releases instead of just F28+.
- Remove --cleanup from cassandane invocation.

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 09 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-3
- Re-enable clamav and mariadb support as those are now built with openssl 1.1.
- But no clamav on ppc64 because of
  https://bugzilla.redhat.com/show_bug.cgi?id=1534071

* Thu Jan 04 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-2
- Reorganize some test exclusions so things build on all releases.

* Thu Jan 04 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-1
- Update to 3.0.5.
- Add one new failing test.
- Remove one now-passing test on rawhide.

* Mon Dec 18 2017 Pavel Zhukov <pzhukov@redhat.com> - 3.0.4-6
- Rebuild with new net-snmp

* Thu Nov 30 2017 Pete Walter <pwalter@fedoraproject.org> - 3.0.4-5
- Rebuild for ICU 60.1

* Wed Nov 29 2017 Pavel Zhukov <pzhukov@redhat.com> - 3.0.4-4
- Do not require tcp_wrappers (#1518759)

* Tue Nov 14 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.4-3
- Rebuild for new libical.
- Add patch to fix compilation error with new libical.
- Disable two tests which fail due to the new libical.

* Tue Oct 24 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.4-2
- Fix typo in default config;
  https://bugzilla.redhat.com/show_bug.cgi?id=1506000

* Tue Sep 05 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 3.0.4-1
- Update to 3.0.4
- Patched cassandane for new behaviour. It should be updated idealy.
- Disable ImapTest.urlauth2 test; it seems to fail randomly regardless of
  architecture.

* Fri Aug 11 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.3-1
- Update to 3.0.3, which contains an important security fix.  The fix is not
  embargoed but no CVE has been assigned yet.
- Drop patches merged upstream.
- An update of imaptest has resulted in three additional cassandane failures,
  reported upstream as https://github.com/cyrusimap/cyrus-imapd/issues/2087.
  In order to get the security fix out without delay, those three tests have been
  disabled.

* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 3.0.2-9
- Rebuilt after RPM update (№ 3)

* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 3.0.2-8
- Rebuilt for RPM soname bump

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Jun 30 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-5
- Add two patches from upstream which fix JMAPCalendars issues on 32-bit and
  big-endian architectures.
- Clean up test invocation and exclusion list.  More tests pass now.

* Wed Jun 28 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-4
- Explicitly set specialusealways: 1 in the default config.

* Tue Jun 27 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-3
- Patch the provided imapd.conf and cyrus.conf to more closely match previous
  Fedora defaults and directories included in this package and to enable
  features which are supported by the Fedora build.
- Add tmpfiles.d configuration file for directories in /run.

* Tue Jun 27 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-2
- Exclude one more test from 32-bit arches.  Looks like this failure crept in
  with the Cassandane update.

* Thu Jun 22 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-1
- Update to 3.0.2.
- New Cassandane snapshot, with more tests (all of which are passing).

* Tue Jun 20 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-7
- Add old /usr/lib/cyrus-imapd directory to the utils package and add a symlink
  there to the deliver binary.  This should help a bit with migrations.
- Add upstream patch to fix reconstruct failures on 32-bit architectures.
  Re-enable those five Cassandane tests.

* Thu Jun 15 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-6
- Rename two commands: quota -> cyr_quota, restore -> cyr_restore.
- Fix Cassandane to handle those renames.
- Fix location of cyr_fetchnews.
- Fix Perl 5.26-related module linking issue which caused a test failure.
  Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1461669

* Tue Jun 06 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-5
- Use proper path to ctl_mboxlist in cron file.
- Add patch to increase individual test timeout.  Sometimes armv7hl can't
  complete a single test in 20 seconds.
- Disable the Metronome tests; upstream says that they just won't reliably on
  shared hardware.
- Don't bother running Cassandane on s390x for now.  The machines are simply
  too slow.

* Tue Jun 06 2017 Jitka Plesnikova <jplesnik@redhat.com> - 3.0.1-4
- Perl 5.26 rebuild

* Fri Jun 02 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-3
- Remove clamav from build requirements.
- Add --cleanup to Cassandane call to hopefully reduce build disk usage.
- Disable maxforkrate test on s390x; our builders are too slow to run it.

* Fri Jun 02 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-2
- Add patch to fix up some endianness issues.
- Enable both test suites on all architectures.
- Add arch-specific excludes for a few Cassandane tests.

* Thu Apr 20 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.1-1
- Initial attempt at importing 3.0.  Many new dependencies.
- Use a stock sample imapd.conf file instead of a Fedora-provided one.

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Jan 09 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 2.5.10-2
- Rename httpd manpage to "cyrhttpd" to avoid conflict with the httpd package.

* Wed Nov 23 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 2.5.10-1
- Initial update to the 2.5 series.
- Significant spec cleanups.
- Add sscg dep and follow
  https://fedoraproject.org/wiki/Packaging:Initial_Service_Setup for initial
  cert generation.
- Change default conf to use the system crypto policy.

* Sat Jan 01 2000 Pavel Zhukov <pzhukov@redhat.com> - 0.0.1-1
- See /usr/share/doc/cyrus-imapd/CHANGELOG.rpm for more history