SUSE Support

Here When You Need Us

cyrus-imap: mail delivery to mailbox fails after upgrade from SLES 11 SP4 to SLES 15

This document (000019715) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server SLES 15 SP2
​​​​​SUSE Linux Enterprise Server SLES 15 SP1
SUSE Linux Enterprise Server SLES 15
SUSE Linux Enterprise Server SLES 11 SP4

Situation

The system did use cyrus-imad  prior to it being upgraded.
Following the upgrade, no more mail is delivered to users inboxes.
User do report that they can not connect at all to either imap or pop3 service.

Resolution

There two possible solutions.Migrate to dovecot
zypper in dovecot

The dovecot-wiki provides a link to a script which help you to do the database migration. There is also an introduction to dovecot configuration in the wiki. Cyrus-imapd is not needed to be installed for the migration. Dovecot has to be stopped during mailbox migration.

Download the script and make it executable (!!! SECURITY WARNING, carefully check the script as it is from an external source !!!)

cd /root/bin
wget 'https://github.com/a-schild/cyrus2dovecot/raw/master/cyrus2dovecot'
chmod +x cyrus2dovecot

create a script /root/bin/convert-mailboxes.sh to convert each user mailbox

#!/bin/sh
  
in=/var/spool/imap/user         # Cyrus INBOXes.
db=/var/lib/imap/user/?         # Cyrus seen/subscription files.
log=/tmp/conversion.log         # Log of successful conversions.
err=/tmp/error.log              # Log of conversion errors.
quota=2147483648                # 2 GiB quota (for maildirsize).

for u in `find $in/. \! -name . -prune -exec basename \{\} \;`
do
  out=$(eval echo ~$u)
  group=$(id -gn $u)
  cyrus2dovecot --cyrus-inbox $in/$u                \
                --cyrus-seen $db/$u.seen            \
                --cyrus-sub $db/$u.sub              \
                --default-quota $quota              \
                --edit-foldernames 's/^\./.INBOX./' \
                --dovecot-inbox $out/Maildir        \
                $u 2>&1 >>$log | tee -a $err >&2
  find $out/Maildir -type d -exec chown $u.$group {} \;
  find $out/Maildir -type d -exec chmod 755 {} \;
  find $out/Maildir -type f -exec chown $u.$group {} \;
  find $out/Maildir -type f -exec chmod 600 {} \;
done

make it executable and run it

chmod +x convert-mailboxes.sh
convert-mailboxes.sh

Allow login without SSL to be compatible with old cyrus-imapd  setup. For stronger security skip this step, but clients may complain they get authentication failures when try to connect to imap/pop3
edit file /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no
auth_mechanisms = plain login

change and enable the SSL settings for dovecot in file /etc/dovecot/conf.d/10-ssl.conf

ssl=yes
ssl_cert = </etc/ssl/servercerts/servercert.pem
ssl_key = </etc/ssl/servercerts/serverkey.pem

enable and start dovecot :

systemctl enable dovecot.service
systemctl start dovecot.service

After successful migration and dovecot configuration change postfix to deliver email via dovecot by editing file /etc/postfix/main.cf

mailbox_command = /usr/lib/dovecot/deliver
mailbox_transport =
and restart postfix
systemctl restart postfix.service



If any help is needed for the migration please contact SUSE Consulting or perhaps use the community supported version of cyrus-imapd from PackageHub instead :

SUSEConnect --list-extensions | grep "PackageHub" | cut -dp -f2- | xargs SUSEConnect -p
zypper in cyrus-imapd 
cp /etc/imapd.rpmsave /etc/imapd.conf 
systemctl daemon-reload 
systemctl enable cyrus 
systemctl start cyrus

Cause

cyrus-imapd is no longer available in SLES 15 and therefore has been removed during the upgrade.
There is no automatic migration to dovecot possible.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000019715
  • Creation Date: 17-Sep-2020
  • Modified Date:25-Sep-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.