vmail .my.cnf
This commit is contained in:
parent
089a429193
commit
3f9d2e31f3
|
@ -6,9 +6,8 @@ if [ "$USER" != "vmail" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
readonly MYSQL_CONNECTION_INFO_FILE=/usr/local/etc/vmail-db-info.conf
|
|
||||||
readonly VMAIL_DIR=/var/vmail
|
readonly VMAIL_DIR=/var/vmail
|
||||||
readonly VMAIL_DB=vmail
|
readonly MYSQL_CONNECTION_INFO_FILE=$VMAIL_DIR/.my.cnf
|
||||||
|
|
||||||
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable
|
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable
|
||||||
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then
|
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then
|
||||||
|
|
|
@ -77,6 +77,15 @@ apt -y install exim4-daemon-heavy spf-tools-perl spamassassin libclass-dbi-mysql
|
||||||
usermod -a -G ssl-cert Debian-exim
|
usermod -a -G ssl-cert Debian-exim
|
||||||
useradd --create-home --home-dir /var/vmail --shell /usr/sbin/nologin --system --user-group vmail
|
useradd --create-home --home-dir /var/vmail --shell /usr/sbin/nologin --system --user-group vmail
|
||||||
|
|
||||||
|
# configure vmail user .my.cnf for db access
|
||||||
|
install --owner=vmail --group=vmail --mode=640 /dev/null /var/vmail/.my.cnf
|
||||||
|
echo "[client]" > /var/vmail/.my.cnf
|
||||||
|
echo "host = localhost" >> /var/vmail/.my.cnf
|
||||||
|
echo "database = vmail" >> /var/vmail/.my.cnf
|
||||||
|
echo "user = vmail" >> /var/vmail/.my.cnf
|
||||||
|
echo "password = $VMAILPASS" >> /var/vmail/.my.cnf
|
||||||
|
echo "socket = /var/run/mysqld/mysqld.sock" >> /var/vmail/.my.cnf
|
||||||
|
|
||||||
# configure vmail dirs
|
# configure vmail dirs
|
||||||
chmod 750 /var/vmail/
|
chmod 750 /var/vmail/
|
||||||
if [ ! -d "/etc/ssl/dkim" ]; then
|
if [ ! -d "/etc/ssl/dkim" ]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user