From 862aacf8763f01e18075156bea2708c502e64556 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Feb 2018 22:18:46 +0000 Subject: [PATCH] Wait for bdsmail initialisation --- src/freedombone-app-bdsmail | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-bdsmail b/src/freedombone-app-bdsmail index 83bef91d..426dcbc2 100755 --- a/src/freedombone-app-bdsmail +++ b/src/freedombone-app-bdsmail @@ -252,12 +252,21 @@ function install_bdsmail { echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain chmod +x /usr/bin/bdsmail_domain + # wait for domain to be generated by the daemon + sleep 10 + + bds_domain=$(bdsmail_domain) + if [ ! $bds_domain ]; then + echo $'Failed to get the bdsmail domain' + exit 8934638 + fi + # Create mutt configuration mkdir /etc/skel/.mutt echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail echo 'set smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail - echo "set from=username@$(bdsmail_domain)" >> /etc/skel/.mutt/bdsmail + echo "set from=username@${bds_domain}" >> /etc/skel/.mutt/bdsmail echo 'set spoolfile=/etc/bdsmail/mail/username' >> /etc/skel/.mutt/bdsmail # mutt configuration for the admin user