postfix/convert-bdb-to-lmdb.sh
Peter Varkoly 17ec2d520b - Set default lmd to default db.
- Convert btree tables to lmdb too. Stop postfix befor converting from
  bdb to lmdb
- This package is without bdb support. That's why convert must be done

OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=399
2021-01-05 10:18:13 +00:00

24 lines
582 B
Bash

#!/bin/bash
systemctl stop postfix
if grep -q "hash:" /etc/postfix/{main.cf,master.cf}; then
sed -i 's/hash:/lmdb:/g' /etc/postfix/{main.cf,master.cf}
fi
if grep -q "btree:" /etc/postfix/{main.cf,master.cf}; then
sed -i 's/btree:/lmdb:/g' /etc/postfix/{main.cf,master.cf}
fi
for i in $( find /etc/postfix/ -name "*.db" )
do
mv $i $i-back
postmap ${i%.db}
done
for i in $( find /etc/aliases.d/ -name "*.db" )
do
mv $i $i-back
postalias ${i%.db}
done
if [ -e /etc/aliases.db ]; then
mv /etc/aliases.db /etc/aliases.db-back
postalias /etc/aliases
fi
systemctl start postfix