Package Details: cyrus-imapd 3.0.11-2

Git Clone URL: https://aur.archlinux.org/cyrus-imapd.git (read-only)
Package Base: cyrus-imapd
Description: An email, contacts and calendar server
Upstream URL: https://www.cyrusimap.org/
Licenses: BSD
Provides: imap-server, pop3-server
Submitter: ryanc
Maintainer: J5lx
Last Packager: J5lx
Votes: 22
Popularity: 0.128475
First Submitted: 2007-10-14 08:22
Last Updated: 2019-09-10 01:25

Dependencies (41)

Required by (2)

Sources (9)

Pinned Comments

J5lx commented on 2019-03-16 02:24

I just updated this package to Cyrus 3.0.9 and will push that update in a moment. Since Cyrus 3.0 is a major new version to begin with, I also used the opportunity to make some major changes to this package as well, mostly in order to adhere to certain conventions or as a matter of housekeeping. In doing so I have tried to bring the package back into a good shape after that long-time lack of maintenance, but if there’s something you are unhappy with or if you have further suggestions for improvement, please let me know. Since the changes are so unusually extensive, here’s a rundown of them, how they impact the upgrade procedure (if so) and some reasoning behind them.

  • The most important bit first: Please stop Cyrus before upgrading – there are changes in both this package and Cyrus itself that could otherwise prevent a clean upgrade.
  • Please also read through the upgrade guide before performing the upgrade.
  • Before 3.0, the Cyrus documentation suggested using /var/imap and /var/spool/imap as the config directory and location for partitions, respectively. In 3.0, most materials, including the example config files, point to /var/lib/cyrus and /var/spool/cyrus instead. Therefore, I have changed the default paths in this package as well, however there is no automatic migration, so if you want to migrate to the new directories you will have to do so manually. Of course you can keep using the previous directories as well if you want.
  • Previously, the cyrus user was assigned a random non-system uid (>=1000). Now, it uses a fixed uid and gid of 70, which has been assigned to it for a long time. The id is updated automatically, however you will have to adjust the permissions of paths owned by that user manually, including the previously mentioned /var/imap and /var/spool/imap.
  • The systemd unit has been renamed from cyrus-master.service to cyrus-imapd.service, to make the name more predictable and consistent with other services. cyrus-imapd.service is also the name used by every other distribution I could find, and is even referred to in Cyrus’s own documentation. However this change means that you will have to re-enable the service if it was enabled before.

Additionally, the following changes have also been made, but usually these should not impact the upgrade procedure:

  • The /etc/conf.d/cyrus-master configuration file has been removed. It wasn’t even being used before, and I believe most people won’t need to adjust the command-line parameters anyway. If you still need to do so, you can create a drop-in file for the systemd unit.
  • I’ve completely overhauled the build configuration. In the process, I’ve decided to enable a number of features which weren’t enabled by default. This means that the package has now more dependencies than before, however many of them are likely to be installed on a (mail) server anyway – for example, sqlite, postgresql-libs and mariadb-libs are also needed for postfix and opendkim, among others, while libnghttp2, krb5 and libldap are directly or indirectly required by the ubiquitous curl package. I tried to make a sensible selection, but I’m open to suggestions. I decided against splitting individual components out, but I’m also open to discussing this decision as well.
  • Speaking of split packages, there is now one containing the Cyrus documentation, which was completely overhauled in 3.0.
  • The package no longer conflicts with imap-server and pop3-server. I believe all files which could warrant such a conflict (particularly imapd and pop3d) currently reside in Cyrus’s own libexec directory, but let me know if I overlooked something.
  • !makeflags has been removed from options. I tried building with multiple simultaneous jobs and couldn’t find any problems. Again, let me know if I was mistaken.
  • The install file has been rewritten from scratch. User creation is now handled by systemd-sysusers. The state directories are no longer initialised automatically – this should now be done manually by running mkimap as cyrus:mail (invoke it as sudo runuser -u cyrus -g mail mkimap /etc/cyrus/imapd.conf, for example). They are also no longer set to update synchronously on ext[234] file systems, since this was only ever meant for systems using ext2 which is so ancient that I’m not going to explicitly support it. The configuration files are no longer chowned to cyrus and made read-only to everyone else, as is normally the case for such configuration files.
  • Perl files are now installed into vendor_perl rather than site_perl, as per Perl package guidelines.

Latest Comments

1 2 3 4 5 6 ... Next › Last »

J5lx commented on 2019-09-10 01:31

Small update: I finally figured out how to make the documentation build with Sphinx 2, so the dependency on Sphinx 1 is now gone and there is no longer any need for that virtualenv hack either. I’m sorry that I could’t get it done any earlier.

J5lx commented on 2019-06-21 21:50

guygma: Thanks for the submission. It’s not my way of doing things (I’d rather do it the way it is now or come up with a patch to make it work with Sphinx 2) but I’ll pin a link to it for those who prefer your solution (I don’t want to pin the PKGBUILD itself because that’d push the upgrade note down by a lot). My primary reason for this is that with your solution, the use of pip will result in lots of downloads during the build phase, and this means that if you’re building packages in a clean environment like a chroot (as you have done yourself), those dependencies can’t be cached and will have to be re-downloaded for every package build that needs them. The way it is now, you might have to install “over 200MB” (according to zork, haven’t checked myself) of python2-sphinx dependencies in whatever your build environment is, however those only need to be downloaded once and can then be re-used for every build that needs them. Using pip, on the other hand, these dependencies will have to be re-downloaded on every build, e.g. (presumably) for the next version or (especially important for me) when implementing and testing changes to the packaging process.

Edit: While I won’t be incorporating this change, I do see that it makes the build process more tedious and I’ll give patching for version 2 another try when I find some time for it next week.

Also, on a different note, if you’re here for JMAP support, I’m afraid you’ll have to be a little more patient, since experimental JMAP support was removed in version 3.0.6 and is now planned to have its full release in a later version. Alternatively, if you can’t stand the wait, you could try an unstable version (3.1.x) or the latest code from the master branch. Right now the --enable-jmap option is simply ignored (as you’ll see in build output: configure: WARNING: unrecognized options: --enable-jmap).

zork commented on 2019-06-21 19:16

guygma: Many thanks for your work! It is great that I do not have to install over 200Mb of python2-sphinx dependencies just to build cyrus. Thanks again!

guygma commented on 2019-06-21 12:59

OK, so I have updated the PKGBUILD and managed to build in a clean chroot with all of the options enabled (including xapian). I have included the PKGBUILD below in the hopes it makes it easy for the maintainer to update it if they see fit. Also, those who take care to read it may input the edits themselves on their local copy if they had trouble with the previous version as I did.

I believe I have incorporated the suggestions made by all the recent comments in this thread.

EDIT: I can also confirm that --enable-jmap builds properly, which is fantastic as JMAP functionality was the main reason I am moving from Dovecot to Cyrus.

pkgbase=cyrus-imapd
pkgname=(cyrus-imapd cyrus-imapd-docs)
pkgver=3.0.10
pkgrel=1
pkgdesc="An email, contacts and calendar server"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="https://www.cyrusimap.org/"
license=('BSD')
makedepends=('libsasl' 'icu' 'jansson' 'libical' 'libxml2' 'krb5' 'sqlite'
             'mariadb-libs' 'postgresql-libs' 'libnghttp2' 'brotli' 'shapelib'
             'libldap' 'libcap' 'net-snmp' 'xapian-core' 'perl' 'clamav'
             'python-virtualenv' 'perl-pod-pom-view-restructured'
             'perl-module-install' )
source=("https://www.cyrusimap.org/releases/${pkgbase}-${pkgver}.tar.gz"{,.sig}
        "2750.patch::https://github.com/cyrusimap/cyrus-imapd/pull/2750/commits/ad4d5fb85e1480158ee32c9b0d3d0baeac2c324a.patch"
        "perl-libs.patch"
        "vzic-flags.patch"
        "imapd.conf.patch"
        "cyrus-imapd.service"
        "cyrus-imapd.sysusers.conf"
        "cyrus-imapd.tmpfiles.conf")
validpgpkeys=('5B55619A9D7040A9DEE2A2CB554F04FEB36378E0')
sha512sums=('1ae153a8f181bbe020326bec2dc177b78ef3c442f94e24e89b7a719298d93701006596dd21fa1c3a40afd75f01162b03524cf793dd7438ec7192f9a13f7614d0'
            'SKIP'
            'bc4df5a743689cf674d50f32ce04308a6ac9ee167f62fc25cf30d186f8e79523441062e5043f8eab422d8fd8f1c9b8a658d4b3ebe203a27795b793f477364a67'
            '6c1cec2d2cecc000cfa0a95befba75e303a151c6552148c671ef3b054ae7cce457571e0c8d416bb0b2fc83f86d27d2e477ea0073b8fa8ea295f14f5165aae6d5'
            'ff1adb55abb059f0c022ae3e375c0a099278d69174bef712b85af40b00fa68a6d49604d09f80195a429ff842813e914557d7aff773231776cbbc5037164c180a'
            '0862ffc8c05208efd4d2fb50a6e3719ebc65fc2d72f8e6404235aa32cc44d8227056a17b78f2726e15ff8e38d473795f837c34bfbe89b694b2298c9baab9d5db'
            '738242e80cec2c25ae6a85a889cc8d35d7c2f43b2b4d64d74f99a230b21024f168a885f1e319aec1aab0e0599e41211478b99dc608a4ba036be90f8d7e23fd96'
            '28612e491371515b414ce6d34554f1c2286624f5b80872e6be7037a2cccba1ed5bd2c4bfed27ed978478debdfb5f3d56aaa30d767f50b125f2ad38e76a37702c'
            '70fedcd78f4e505038e2716a0446e7bb7f7a344faf2ab43c51f47380ff56a9c2407cfbe0f24c006618a901e44ff124a7f6ed19203478a6b852d7bda7771210c5')

prepare() {
  cd "${srcdir}/${pkgbase}-${pkgver}"

  patch -Np1 < "${srcdir}/2750.patch"
  patch -Np1 < "${srcdir}/perl-libs.patch"
  patch -Np1 < "${srcdir}/vzic-flags.patch"
  autoreconf
}

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"

  python -m virtualenv --system-site-packages .
  chmod +x bin/activate
  source bin/activate
  pip install sphinx==1.8.5
  export PERL_MM_OPT="NO_PACKLIST=true"
  # Work around Cyrus bug #2629
  export LDFLAGS="${LDFLAGS/,--as-needed}"

  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib/cyrus \
    --sysconfdir=/etc/cyrus \
    --sbindir=/usr/bin \
    --enable-xapian \
    --enable-jmap \
    --enable-autocreate \
    --enable-idled \
    --enable-nntp \
    --enable-murder \
    --enable-http \
    --enable-calalarmd \
    --enable-replication \
    --enable-backup \
    --with-mysql=yes \
    --with-pgsql=yes \
    --with-ldap \
    --with-libcap \
    --with-pidfile=/run/cyrus-master.pid \
    --with-syslogfacility=MAIL

  make
  make -C tools/vzic
}

check() {
  cd "${srcdir}/${pkgbase}-${pkgver}"

  make check
  deactivate
}

package_cyrus-imapd() {
  depends=('libsasl' 'icu' 'jansson' 'libical' 'libxml2' 'krb5' 'sqlite'
           'mariadb-libs' 'postgresql-libs' 'libnghttp2' 'brotli' 'shapelib'
           'libldap' 'libcap' 'net-snmp' 'xapian-core' 'perl')
  optdepends=('cyrus-imapd-docs: documentation'
              'clamav: for cyr_virusscan')
  provides=('imap-server' 'pop3-server')
  backup=('etc/cyrus/cyrus.conf' 'etc/cyrus/imapd.conf')
  install="${pkgname}.install"

  cd "${srcdir}/${pkgbase}-${pkgver}"

  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"

  # perllocal.pod is undesired in packages
  eval local $(perl -V:installarchlib)
  rm "${pkgdir}/${installarchlib}/perllocal.pod"
  rmdir "${pkgdir}/${installarchlib}"

  # Rename httpd.8 and master.8 so they don't conflict with the identically
  # named manpages from postfix and apache
  mv "${pkgdir}/usr/share/man/man8/httpd.8" \
    "${pkgdir}/usr/share/man/man8/httpd.8cyrus"
  mv "${pkgdir}/usr/share/man/man8/master.8" \
    "${pkgdir}/usr/share/man/man8/master.8cyrus"

  # Install additional utilities
  for i in arbitronsort.pl masssievec mkimap mknewsgroups rehash \
           translatesieve; do
    install -Dm755 "tools/${i}" "${pkgdir}/usr/bin/${i}"
  done
  # Vzic is needed to convert timezone information for CalDAV. Since Cyrus
  # includes a variant that has been modified for its own needs, we're
  # installing it under a different name to avoid conflicts
  install -Dm755 tools/vzic/vzic \
    "${pkgdir}/usr/bin/cyrus-vzic"
  install -Dm755 tools/vzic/vzic-merge.pl \
    "${pkgdir}/usr/bin/cyrus-vzic-merge.pl"
  # vzic-test.pl and vzic-dump.pl appear to be meant for development/testing

  # Install additional manpages
  for i in arbitronsort.pl synctest dav_reconstruct; do
    install -Dm644 "man/${i}.1" "${pkgdir}/usr/share/man/man1/${i}.1"
  done
  for i in cvt_xlist_specialuse cyradm cyrdump cyr_sequence cyr_userseen \
           lmtpproxyd masssievec mkimap mknewsgroups mupdate pop3proxyd proxyd \
           ptdump ptexpire ptloader rehash sievec sieved translatesieve; do
    install -Dm644 "man/${i}.8" "${pkgdir}/usr/share/man/man8/${i}.8"
  done

  # Install configuration files
  install -Dm644 doc/examples/cyrus_conf/normal.conf \
    "${pkgdir}/etc/cyrus/cyrus.conf"
  install -Dm644 doc/examples/imapd_conf/normal.conf \
    "${pkgdir}/etc/cyrus/imapd.conf"
  patch "${pkgdir}/etc/cyrus/imapd.conf" "${srcdir}/imapd.conf.patch"
  # Example cyrus.conf and imapd.conf use different socket paths, but they need
  # to match
  sed -i 's@/var/imap/socket/@/run/cyrus/socket/@' \
    "${pkgdir}/etc/cyrus/cyrus.conf"

  # Install default directories
  install -dm750 -o70 -gmail \
    "${pkgdir}/var/lib/cyrus" \
    "${pkgdir}/var/spool/cyrus" \
    "${pkgdir}/var/spool/sieve"

  # Install system files
  install -Dm644 "${srcdir}/cyrus-imapd.service" \
    "${pkgdir}/usr/lib/systemd/system/cyrus-imapd.service"
  install -Dm644 "${srcdir}/cyrus-imapd.sysusers.conf" \
    "${pkgdir}/usr/lib/sysusers.d/cyrus-imapd.conf"
  install -Dm644 "${srcdir}/cyrus-imapd.tmpfiles.conf" \
    "${pkgdir}/usr/lib/tmpfiles.d/cyrus-imapd.conf"

  # Install Documentation
  install -Dm644 -t "${pkgdir}/usr/share/doc/cyrus-imapd/" \
    README.md doc/README.*
  cp -r doc/examples "${pkgdir}/usr/share/doc/cyrus-imapd/examples"

  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

package_cyrus-imapd-docs() {
  pkgdesc="Documentation for the Cyrus IMAP server"
  arch=('any')

  cd "${srcdir}/${pkgbase}-${pkgver}"

  install -dm755 "${pkgdir}/usr/share/doc/cyrus-imapd"
  cp -r doc/html doc/internal doc/legacy doc/text \
    "${pkgdir}/usr/share/doc/cyrus-imapd"

  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

J5lx commented on 2019-06-17 20:22

Yes, it should, but sometimes dependencies get overlooked. As you can see, both I and another user already noted the missing dependency in the comment section of perl-pod-pom back in march, however the maintainer still hasn’t taken action.

On another note, please make sure you have a basic understanding of how installing packages from AUR works. Since you seemingly weren’t aware of the issue with perl-pod-pom and thought it was a problem with this package, I’m suspecting you are using some AUR helper to install these packages. However, it is pretty dangerous to use those tools without an understanding of what exactly they are doing, since the packages on the AUR are created by other users and there is no guarantee they won’t do malicious things to your system. The AUR wiki article should be a good starting point for learning more. If you do know all that already, though, I guess you’ll be safe; I’m just trying to be helpful :)

Edit: Well, looks like someone was faster than me. I shouldn’t try to work on too many things at the same time I guess ^^

zork commented on 2019-06-17 20:02

guygma: yes, but the problem two level depth in cyrus-imapd dependency tree. cyrus-imapd PKGBUILD is fine.

guygma commented on 2019-06-17 20:00

Ok, I will try that... but shouldn’t these things be dependencies defined in the PKGBUILD? I was not at all thinking a set of packages was missing.

zork commented on 2019-06-17 19:38

guygma: pacman -S perl-module-install

See https://aur.archlinux.org/packages/perl-pod-pom/ This is a depenency of perl-pod-pom-view-restructured.

guygma commented on 2019-06-17 19:32

This is breaking for me due to a perl error:

Can't locate inc/Module/Install.pm in @INC (you may need to install the inc::Module::Install module) (@INC contains: /usr/lib/perl5/5.30/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.30/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.30/core_perl /usr/share/perl5/core_perl) at Makefile.PL line 2. BEGIN failed--compilation aborted at Makefile.PL line 2. ==> ERROR: A failure occurred in build().

Can anyone make sense of this and/or are others experiencing it? It is not a path resolution issue

J5lx commented on 2019-05-08 13:20

I just updated the package to fix all the issues you reported. I'll have to look into upstreaming some of those patches sometime, but for now at least everything should work again. I tried fixing the compatibility issues with Sphinx 2 but that turned out to trickier than I first thought, so for the time being we'll indeed need to build with Sphinx 1. While old versions of the python-sphinx package might work for that purpose, I also turned 1.8.5-1 into the AUR package python-sphinx1 which can be updated should other updates break Sphinx 1.

In April the start of the summer semester kinda messed up my organisation, hence the long wait. Sorry about that! If there are any other issues left, let me know and I should be able to get them resolved much faster now.

Edit: TheGoliath, I noticed I didn't address your comment about the missing perl-module-install. I couldn't reproduce that issue in this package, but I know perl-pod-pom has an issue like that which the maintainer has yet to fix. Might you be referring to that package rather than this one?