Skip to content

Commit 0c1bc35

Browse files
author
Till Brehm
committed
Merge branch 'master' of git.ispconfig.org:ispconfig/ispconfig3
2 parents c52fa27 + 85fdab1 commit 0c1bc35

File tree

4 files changed

+36
-23
lines changed

4 files changed

+36
-23
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ function update($event_name, $data) {
595595

596596
//* Unmount the old log directory bfore we move the log dir
597597
//exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
598-
exec('umount '.escapeshellcmd($old_dir.'/log'));
598+
exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
599599

600600
//* Create new base directory, if it does not exist yet
601601
if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -691,7 +691,8 @@ function update($event_name, $data) {
691691
$app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
692692
exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
693693
//* add mountpoint to fstab
694-
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0';
694+
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait';
695+
$fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev 0 0':' 0 0';
695696
$app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
696697
}
697698

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 &');

server/plugins-available/nginx_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ function update($event_name, $data) {
476476

477477
//* Unmount the old log directory bfore we move the log dir
478478
//exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
479-
exec('umount '.escapeshellcmd($old_dir.'/log'));
479+
exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
480480

481481
//* Create new base directory, if it does not exist yet
482482
if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -572,7 +572,8 @@ function update($event_name, $data) {
572572
$app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
573573
exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
574574
//* add mountpoint to fstab
575-
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0';
575+
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait';
576+
$fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev 0 0':' 0 0';
576577
$app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
577578
}
578579

server/plugins-available/postfix_server_plugin.inc.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -161,27 +161,30 @@ function update($event_name, $data) {
161161
exec('postfix reload');
162162
}
163163

164-
if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
165-
// If dovecot switch to lmtp
166-
if($app->system->is_installed('dovecot')) {
167-
exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
168-
exec('postfix reload');
169-
$app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
170-
exec($conf['init_scripts'] . '/' . 'dovecot restart');
171-
}
172-
}
173-
else {
174-
// If dovecot switch to dovecot
175-
if($app->system->is_installed('dovecot')) {
176-
exec("postconf -e 'virtual_transport = dovecot'");
177-
exec('postfix reload');
178-
$app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
179-
exec($conf['init_scripts'] . '/' . 'dovecot restart');
164+
if($app->system->is_installed('dovecot')) {
165+
$temp = exec("postconf -n virtual_transport", $out);
166+
if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
167+
// If dovecot switch to lmtp
168+
if($out[0] != "virtual_transport = lmtp:unix:private/dovecot-lmtp") {
169+
exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
170+
exec('postfix reload');
171+
$app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
172+
exec($conf['init_scripts'] . '/' . 'dovecot restart');
173+
}
174+
} else {
175+
// If dovecot switch to dovecot
176+
if($out[0] != "virtual_transport = dovecot") {
177+
exec("postconf -e 'virtual_transport = dovecot'");
178+
exec('postfix reload');
179+
$app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
180+
exec($conf['init_scripts'] . '/' . 'dovecot restart');
181+
}
180182
}
181183
}
182184

183-
exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'");
184-
exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'");
185+
exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); //TODO : no reload?
186+
exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'"); //TODO : no reload?
187+
185188

186189
}
187190

0 commit comments

Comments
 (0)