+# upgrading dovecot < 2.0
+i=0
+for a in /etc/dovecot/dovecot-db-example.conf \
+ /etc/dovecot/dovecot-dict-sql-example.conf \
+ /etc/dovecot/dovecot-ldap-example.conf \
+ /etc/dovecot/dovecot-sql-example.conf \
+ /etc/dovecot/dovecot.conf; do
+ if [ -f "$a" ]; then
+ [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
+ i=1
+ echo "Trying to migrate $a config file to dovecot 2."
+ cp -a "$a" "$a-1.2.org"
+ :> "$a.log"
+ chmod 600 "$a.log"
+ # convert config and prefix stderr lines with #
+ %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
+ fi
+done
+if [ "$i" -eq 1 ]; then
+ echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
+fi