1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-29 03:27:05 +00:00
mailinabox/scripts/add_mail_user.sh

16 lines
415 B
Bash
Raw Normal View History

2013-08-26 21:01:48 +00:00
EMAIL_ADDR=$1
if [ -z "$EMAIL_ADDR" ]; then
echo
echo "Set up your first email account..."
read -e -i "user@`hostname`" -p "Email Address: " EMAIL_ADDR
fi
EMAIL_PW=$2
if [ -z "$EMAIL_PW" ]; then
read -e -p "Email Password: " EMAIL_PW
fi
echo "INSERT INTO users (email, password) VALUES ('$EMAIL_ADDR', '`doveadm pw -s SHA512-CRYPT -p $EMAIL_PW`');" \
2013-08-26 21:01:48 +00:00
| sqlite3 $STORAGE_ROOT/mail/users.sqlite