SHA256
1
0
forked from pool/postfix
postfix/convert-bdb-to-lmdb.sh
Peter Varkoly d5d7245c6d - Set default lmd to default db. Convert btree tables to lmdb too.
This package is without bdb support. That's why convert must be done
  without any suse release condition.
  o remove patch postfix-no-btree.patch
  o add set-default-db-type.patch

OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=398
2021-01-04 12:20:02 +00:00

22 lines
535 B
Bash

#!/bin/bash
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