1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-19 18:17:22 +01:00

move management into a daemon service running as root

* Created a new Python/flask-based management daemon.
* Moved the mail user management core code from tools/mail.py to the new daemon.
* tools/mail.py is a wrapper around the daemon and can be run as a non-root user.
* Adding a new initscript for the management daemon.
* Moving dns_update.sh to the management daemon, called via curl'ing the daemon's API.

This also now runs the DNS update after mail users and aliases are added/removed,
which sets up new domains' DNS as needed.
This commit is contained in:
Joshua Tauberer
2014-06-03 13:24:48 +00:00
parent da15ae5375
commit c54b0cbefc
10 changed files with 530 additions and 198 deletions

View File

@@ -69,9 +69,13 @@ fi
. setup/mail.sh
. setup/dkim.sh
. setup/spamassassin.sh
. setup/dns_update.sh
. setup/web.sh
. setup/webmail.sh
. setup/management.sh
# Write the DNS configuration files.
sleep 2 # wait for the daemon to start
curl -d POSTDATA http://127.0.0.1:10222/dns/update
if [ -t 0 ]; then # are we in an interactive shell?
if [ -z "`tools/mail.py user`" ]; then
@@ -85,3 +89,4 @@ if [ -z "`tools/mail.py user`" ]; then
tools/mail.py alias add postmaster@$PUBLIC_HOSTNAME $EMAIL_ADDR
fi
fi