postfix/convert-bdb-to-lmdb.sh
Peter Varkoly a66dd981a8 Accepting request 858657 from home:adkorte:branches:server:mail
- Set database type for address_verify_map and postscreen_cache_map
  to lmdb (btree requires Berkeley DB)
- Set default database type to lmdb and fix update_postmaps script
- Use variable substition instead of sed to remove .db suffix and
  substitute hash: for lmdb: in /etc/postfix/master.cf as well.
  Check before substitution if there is something to do (to keep
  rpmcheck happy).

OBS-URL: https://build.opensuse.org/request/show/858657
OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=394
2020-12-26 19:40:41 +00:00

19 lines
413 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
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