X-Git-Url: http://id.pley.net/postfix.git/blobdiff_plain/fdc598f0ef23202f882200d2d26a2826e509c932..HEAD:/postfixadmin/setup-postfixadmin.sh?ds=inline diff --git a/postfixadmin/setup-postfixadmin.sh b/postfixadmin/setup-postfixadmin.sh index b19e9e2..11630e0 100755 --- a/postfixadmin/setup-postfixadmin.sh +++ b/postfixadmin/setup-postfixadmin.sh @@ -9,6 +9,9 @@ if [[ -z "$( mysql -u root -e 'SHOW DATABASES LIKE "postfix"' )" ]]; then 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