mailman issues with postmap
In server/plugins-available/mailman_plugin.inc.php in the function insert, postmap should be delayed since previous command newlist is executed on background, so postmap most times is executed before virtual-mailman is quite finished, I added a 5 seconds sleep to be sure, but in high load scenarios could be not enough, perhaps it should be better not to exec with a nohup, so we are shure previous command is fully executed.
function insert($event_name, $data) { global $app, $conf;
$this->update_config();
exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 &");
+++++ sleep(5); if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman'); if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman'); exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &');
$app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ?", $data["new"]['mailinglist_id']);
}