Skip to content

Commit f8bc88f

Browse files
author
Florian Schaal
committed
FS#4017 - mailman issues with postmap
1 parent c8679f3 commit f8bc88f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/plugins-available/mailman_plugin.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ function insert($event_name, $data) {
7373

7474
$this->update_config();
7575

76-
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 &");
76+
$pid = 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 & echo $!;");
77+
// wait for /usr/lib/mailman/bin/newlist-call
78+
$running = true;
79+
do {
80+
exec('ps -p '.intval($pid), $out);
81+
if (count($out) ==1) $running=false; else sleep(1);
82+
unset($out);
83+
} while ($running);
84+
unset($out);
7785
if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman');
7886
if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman');
7987
exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &');

0 commit comments

Comments
 (0)