Wait for bdsmail initialisation

This commit is contained in:
Bob Mottram 2018-02-11 22:18:46 +00:00
parent 935fc2234f
commit 862aacf876
1 changed files with 10 additions and 1 deletions

View File

@ -252,12 +252,21 @@ function install_bdsmail {
echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain
chmod +x /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 # Create mutt configuration
mkdir /etc/skel/.mutt mkdir /etc/skel/.mutt
echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail 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 smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail
echo 'set use_from=yes' >> /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 echo 'set spoolfile=/etc/bdsmail/mail/username' >> /etc/skel/.mutt/bdsmail
# mutt configuration for the admin user # mutt configuration for the admin user