// Create virtual host and insert to database $rc = $vhost->insert(); if ($rc === false) { echo "[ERROR] Error while adding virtual host.\n"; exit(9); } // NSD $feature = new Nsd(); $rc = $feature->exportConfiguration($db); if ($rc === false) { echo "[ERROR] Error while exporting NSD configuration.\n"; exit(9); } // Reload NSD if (Config::read('nsd') === 'enabled') { $feature->reload(); } // Postfix $feature = new Postfix(); $rc = $feature->exportConfiguration($db); if ($rc === false) { echo "[ERROR] Error while exporting Postfix configuration.\n"; exit(9); } // Reload Postfix if (Config::read('postfix') === 'enabled') { $feature->reload(); } // Dovecot setup $feature = new Dovecot(); $rc = $feature->exportConfiguration($db);