From 11ac6ea7d7ed2087f7704413c825ba8dfdb9b37c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 1 Nov 2016 19:07:44 +0000 Subject: [PATCH] More checking for email creation --- src/freedombone-base-email | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 9c4ba6ab..e592ae19 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -1649,8 +1649,19 @@ function install_email { read_config_param MY_EMAIL_ADDRESS read_config_param DH_KEYLENGTH - if [ ${#MY_EMAIL_ADDRESS} -lt 3 ]; then + if [ ! $MY_USERNAME ]; then + echo $'No username for email installation' + exit 73672 + fi + if [ ! $DEFAULT_DOMAIN_NAME ]; then + echo $'No default domain name for email installation' + exit 57634 + fi + + my_email="$MY_EMAIL_ADDRESS" + if [ ${#my_email} -lt 3 ]; then MY_EMAIL_ADDRESS=${MY_USERNAME}@${DEFAULT_DOMAIN_NAME} + write_config_param "MY_EMAIL_ADDRESS" "$MY_EMAIL_ADDRESS" fi install_email_basic