From 47a00002fbef83c5e790b1861b4d393587986471 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Tue, 1 Nov 2016 18:37:31 +0000
Subject: [PATCH] Read config parameters before email install

---
 src/freedombone-base-email | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/freedombone-base-email b/src/freedombone-base-email
index 1321c6100..aac97c984 100755
--- a/src/freedombone-base-email
+++ b/src/freedombone-base-email
@@ -78,9 +78,6 @@ function backup_email {
 }
 
 function configure_firewall_for_email {
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
-        return
-    fi
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
         # docker does its own firewalling
         return
@@ -93,7 +90,6 @@ function configure_firewall_for_email {
     firewall_add Email 587 tcp
     firewall_add Email 465 tcp
     firewall_add Imap 993 tcp
-    mark_completed $FUNCNAME
 }
 
 function encrypt_incoming_email {
@@ -1588,8 +1584,7 @@ function configure_gpg {
             if ! grep -q $"Change your GPG password" /home/$MY_USERNAME/README; then
                 echo '' >> /home/$MY_USERNAME/README
                 echo '' >> /home/$MY_USERNAME/README
-                echo $'Change your GPG password' >> /home/$MY_USERNAME/README
-                echo '========================' >> /home/$MY_USERNAME/README
+                echo $'# Change your GPG password' >> /home/$MY_USERNAME/README
                 echo $"It's very important to add a password to your GPG key so that" >> /home/$MY_USERNAME/README
                 echo $"if anyone does get access to your email they still won't be able" >> /home/$MY_USERNAME/README
                 echo $'to read them without knowning the GPG password.' >> /home/$MY_USERNAME/README
@@ -1603,8 +1598,7 @@ function configure_gpg {
             if ! grep -q $"Publish your GPG public key" /home/$MY_USERNAME/README; then
                 echo '' >> /home/$MY_USERNAME/README
                 echo '' >> /home/$MY_USERNAME/README
-                echo $'Publish your GPG public key' >> /home/$MY_USERNAME/README
-                echo '===========================' >> /home/$MY_USERNAME/README
+                echo $'# Publish your GPG public key' >> /home/$MY_USERNAME/README
                 echo $'So that others can send emails to you securely you should' >> /home/$MY_USERNAME/README
                 echo $'publish your GPG public key with the command:' >> /home/$MY_USERNAME/README
                 echo '' >> /home/$MY_USERNAME/README
@@ -1649,6 +1643,12 @@ function install_email {
         return
     fi
 
+    read_config_param ONION_ONLY
+    read_config_param MY_USERNAME
+    read_config_param DEFAULT_DOMAIN_NAME
+    read_config_param MY_EMAIL_ADDRESS
+    read_config_param DH_KEYLENGTH
+
     install_email_basic
     #install_email_with_tor
 
-- 
GitLab