echo Creating \"postfix\" database.
mysql -u root -e 'CREATE DATABASE postfix'
mysql -u root -e 'GRANT ALL PRIVILEGES ON postfix.* TO "postfix"@"localhost"'
+ if [[ -n "$( mysql -u root -e 'SELECT User FROM mysql.user WHERE User = "dovecot"' )" ]]; then
+ mysql -u root -e 'GRANT ALL PRIVILEGES ON postfix.* TO "dovecot"@"localhost"'
+ fi
mysql -u root -e 'FLUSH PRIVILEGES'
fi