--- rpms/smeserver-dovecot-extras/contribs10/smeserver-dovecot-extras.spec 2021/06/01 03:34:43 1.6 +++ rpms/smeserver-dovecot-extras/contribs10/smeserver-dovecot-extras.spec 2022/08/08 06:50:50 1.11 @@ -1,13 +1,14 @@ Summary: Additional features for dovecot on SME Server Name: smeserver-dovecot-extras Version: 0.1.6 -Release: 4%{?dist} +Release: 8%{?dist} License: GPL Group: Networking/Daemons Source: %{name}-%{version}.tar.gz Patch0: smeserver-dovecot-extras-0.1.6-Add-update-event-to-createlinks.patch Patch1: smeserver-dovecot-extras-0.1.6-Fix-sieve-compile.patch Patch2: smeserver-dovecot-extras-0.1.6-bz11551.patch +Patch3: smeserver-dovecot-extras-0.1.6-bz12144-movedb.patch BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch @@ -22,6 +23,15 @@ Requires: acl Add IMAP acl (sharedmailbox) and sieve capabilities to the IMAP server %changelog +* Mon Aug 08 2022 Jean-Philippe Pialasse 0.1.6-8.sme +- fix db overwritten [SME: 12144] + +* Mon Jul 25 2022 Jean-Philippe Pialasse 0.1.6-7.sme +- nothing to backup outside of core folders [SME: 12006] + +* Fri Jul 22 2022 Jean-Philippe Pialasse 0.1.6-5.sme +- add to core backup [SME: 12006] + * Mon May 31 2021 Jean-Philippe Pialasse 0.1.6-4.sme - move spamd entry to spamassassin [SME: 11551] @@ -64,6 +74,7 @@ Add IMAP acl (sharedmailbox) and sieve c %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build perl createlinks @@ -97,9 +108,17 @@ rm -rf $RPM_BUILD_ROOT /usr/sbin/groupadd -g 439 sharedmailbox 2> /dev/null || : %post -# Migrate the sharedmailbox dict to its new location -if [ -e /etc/dovecot/sharedmailbox/dict.db ]; then - mv -f /etc/dovecot/sharedmailbox/dict.db /home/e-smith/db/dovecot/sharedmailbox.db +if [ -s /home/e-smith/db/dovecot/sharedmailbox.db ] ; then + # echo "we already have a non empty file at destination" ; + # delete etc file if empty + if [ -e /etc/dovecot/sharedmailbox/dict.db ] ; then + # if exists and not empty we backup, else we delete + [ -s /etc/dovecot/sharedmailbox/dict.db ] && mv -f /etc/dovecot/sharedmailbox/dict.db /home/e-smith/db/dovecot/dictdb.old || rm -rf /etc/dovecot/sharedmailbox ; + fi +elif [ -e /etc/dovecot/sharedmailbox/dict.db ]; then + # if exists and not empty + [ -s /home/e-smith/db/dovecot/sharedmailbox.db ] && mv -f /etc/dovecot/sharedmailbox/dict.db /home/e-smith/db/dovecot/sharedmailbox.db ; + # then we remove the etc dir ; rm -rf /etc/dovecot/sharedmailbox fi