Skip to content

Commit ebbe637

Browse files
author
Marius Cramer
committed
Merge remote-tracking branch 'origin/stable-3.0.5'
Conflicts: install/tpl/debian_postfix.conf.master install/tpl/fedora_postfix.conf.master install/tpl/gentoo_postfix.conf.master install/tpl/opensuse_postfix.conf.master install/uninstall.php interface/lib/classes/remoting_lib.inc.php interface/lib/classes/tform.inc.php interface/web/mail/lib/lang/de_mail_user.lng interface/web/mailuser/lib/lang/de_mail_user_cc.lng interface/web/sites/aps_install_package.php interface/web/sites/lib/lang/en_web_vhost_subdomain.lng interface/web/sites/web_vhost_domain_edit.php interface/web/sites/web_vhost_subdomain_edit.php server/cron_daily.php server/lib/classes/monitor_tools.inc.php
2 parents 441afe5 + ce1c6d8 commit ebbe637

File tree

94 files changed

+805
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+805
-584
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function configure_dovecot()
9191
} else {
9292
copy('tpl/debian6_dovecot2.conf.master', $config_dir.'/'.$configfile);
9393
}
94+
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
9495
} else {
9596
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) {
9697
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master', $config_dir.'/'.$configfile);
@@ -115,6 +116,9 @@ public function configure_dovecot()
115116
chmod($config_dir.'/'.$configfile, 0600);
116117
chown($config_dir.'/'.$configfile, 'root');
117118
chgrp($config_dir.'/'.$configfile, 'root');
119+
120+
// Dovecot shall ignore mounts in website directory
121+
exec("doveadm mount add '/var/www/*' ignore");
118122

119123
}
120124

install/dist/lib/fedora.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ public function configure_dovecot()
461461

462462
exec("chmod 600 $config_dir/$configfile");
463463
exec("chown root:root $config_dir/$configfile");
464+
465+
// Dovecot shall ignore mounts in website directory
466+
exec("doveadm mount add '/var/www/*' ignore");
464467

465468
}
466469

install/dist/lib/opensuse.lib.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ public function configure_dovecot()
496496

497497
exec("chmod 600 $config_dir/$configfile");
498498
exec("chown root:root $config_dir/$configfile");
499+
500+
// Dovecot shall ignore mounts in website directory
501+
exec("doveadm mount add '/srv/www/*' ignore");
499502

500503
}
501504

@@ -554,7 +557,9 @@ public function configure_amavis() {
554557
unset($content);
555558

556559
// Add the clamav user to the vscan group
557-
exec('groupmod --add-user clamav vscan');
560+
//exec('groupmod --add-user clamav vscan');
561+
$command = 'usermod -a -G clamav vscan';
562+
caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
558563

559564

560565
}
@@ -1076,18 +1081,22 @@ public function install_ispconfig()
10761081
// and must be fixed as this will allow the apache user to read the ispconfig files.
10771082
// Later this must run as own apache server or via suexec!
10781083
if($conf['apache']['installed'] == true){
1079-
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig';
1084+
//$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig';
1085+
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
10801086
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10811087
if(is_group('ispapps')){
1082-
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps';
1088+
//$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps';
1089+
$command = 'usermod -a -G ispapps '.$conf['apache']['user'];
10831090
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10841091
}
10851092
}
10861093
if($conf['nginx']['installed'] == true){
1087-
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig';
1094+
//$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig';
1095+
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
10881096
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10891097
if(is_group('ispapps')){
1090-
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps';
1098+
//$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps';
1099+
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
10911100
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10921101
}
10931102
}

install/lib/install.lib.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ function replaceLine($filename, $search_pattern, $new_line, $strict = 0, $append
637637
$out .= $line;
638638
}
639639
}
640+
if (!$found) {
641+
if (trim($line) == $new_line) {
642+
$found = 1;
643+
}
644+
}
640645
}
641646
if($found == 0) {
642647
//* add \n if the last line does not end with \n or \r
@@ -718,6 +723,32 @@ function get_ispconfig_port_number() {
718723
}
719724
}
720725

726+
/*
727+
* Get the port number of the ISPConfig apps vhost
728+
*/
729+
730+
function get_apps_vhost_port_number() {
731+
global $conf;
732+
if($conf['nginx']['installed'] == true){
733+
$ispconfig_vhost_file = $conf['nginx']['vhost_conf_dir'].'/apps.vhost';
734+
$regex = '/listen (\d+)/';
735+
} else {
736+
$ispconfig_vhost_file = $conf['apache']['vhost_conf_dir'].'/apps.vhost';
737+
$regex = '/\<VirtualHost.*\:(\d{1,})\>/';
738+
}
739+
740+
if(is_file($ispconfig_vhost_file)) {
741+
$tmp = file_get_contents($ispconfig_vhost_file);
742+
preg_match($regex, $tmp, $matches);
743+
$port_number = @intval($matches[1]);
744+
if($port_number > 0) {
745+
return $port_number;
746+
} else {
747+
return '8081';
748+
}
749+
}
750+
}
751+
721752
/*
722753
* Get the port number of the ISPConfig controlpanel vhost
723754
*/

install/lib/installer_base.lib.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,15 @@ public function grant_master_database_rights($verbose = false) {
474474
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
475475
}
476476

477-
$query = "GRANT SELECT, UPDATE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' ";
477+
$query = "GRANT SELECT, UPDATE, DELETE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' ";
478+
if ($verbose){
479+
echo $query ."\n";
480+
}
481+
if(!$this->dbmaster->query($query)) {
482+
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
483+
}
484+
485+
$query = "GRANT SELECT, DELETE ON ".$value['db'].".`aps_instances_settings` TO '".$value['user']."'@'".$host."' ";
478486
if ($verbose){
479487
echo $query ."\n";
480488
}
@@ -972,6 +980,7 @@ public function configure_dovecot() {
972980
} else {
973981
copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile);
974982
}
983+
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
975984
} else {
976985
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master')) {
977986
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master', $config_dir.'/'.$configfile);
@@ -996,6 +1005,9 @@ public function configure_dovecot() {
9961005
chmod($config_dir.'/'.$configfile, 0600);
9971006
chown($config_dir.'/'.$configfile, 'root');
9981007
chgrp($config_dir.'/'.$configfile, 'root');
1008+
1009+
// Dovecot shall ignore mounts in website directory
1010+
exec("doveadm mount add '/var/www/*' ignore");
9991011

10001012
}
10011013

@@ -1527,7 +1539,8 @@ public function configure_apps_vhost() {
15271539
if(!is_user($apps_vhost_user)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
15281540

15291541

1530-
$command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group;
1542+
//$command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group;
1543+
$command = 'usermod -a -G '.$apps_vhost_group.' '.$conf['apache']['user'];
15311544
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
15321545

15331546
if(!@is_dir($install_dir)){
@@ -1542,6 +1555,11 @@ public function configure_apps_vhost() {
15421555
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
15431556
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
15441557
$apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername'];
1558+
1559+
//* Get the apps vhost port
1560+
if($this->is_update == true) {
1561+
$conf['web']['apps_vhost_port'] = get_apps_vhost_port_number();
1562+
}
15451563

15461564
// Dont just copy over the virtualhost template but add some custom settings
15471565
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps.vhost.master', 'tpl/apache_apps.vhost.master');
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE `dbispconfig`.`web_domain` ADD UNIQUE `serverdomain` ( `server_id` , `domain` );
2+
DROP INDEX rr ON dns_rr;
3+
ALTER TABLE `dns_rr` CHANGE `name` `name` VARCHAR( 128 ) NOT NULL ;
4+
CREATE INDEX `rr` ON dns_rr (`zone`,`type`,`name`);

install/sql/ispconfig3.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ CREATE TABLE `client` (
229229
`language` char(2) NOT NULL DEFAULT 'en',
230230
`usertheme` varchar(32) NOT NULL DEFAULT 'default',
231231
`template_master` int(11) unsigned NOT NULL DEFAULT '0',
232-
`template_additional` text NOT NULL DEFAULT '',
232+
`template_additional` text NOT NULL,
233233
`created_at` bigint(20) DEFAULT NULL,
234234
`locked` enum('n','y') NOT NULL DEFAULT 'n',
235235
`canceled` enum('n','y') NOT NULL DEFAULT 'n',
@@ -450,7 +450,7 @@ CREATE TABLE `dns_rr` (
450450
`stamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
451451
`serial` int(10) unsigned default NULL,
452452
PRIMARY KEY (`id`),
453-
UNIQUE KEY `rr` (`zone`,`name`,`type`,`data`)
453+
KEY `rr` (`zone`,`type`,`name`)
454454
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
455455

456456
-- --------------------------------------------------------
@@ -736,8 +736,8 @@ CREATE TABLE `mail_domain` (
736736
`server_id` int(11) unsigned NOT NULL default '0',
737737
`domain` varchar(255) NOT NULL default '',
738738
`dkim` ENUM( 'n', 'y' ) NOT NULL default 'n',
739-
`dkim_private` mediumtext NOT NULL default '',
740-
`dkim_public` mediumtext NOT NULL default '',
739+
`dkim_private` mediumtext NOT NULL,
740+
`dkim_public` mediumtext NOT NULL,
741741
`active` enum('n','y') NOT NULL,
742742
PRIMARY KEY (`domain_id`),
743743
KEY `server_id` (`server_id`,`domain`),
@@ -1689,7 +1689,7 @@ CREATE TABLE `sys_user` (
16891689
`typ` varchar(16) NOT NULL default 'user',
16901690
`active` tinyint(1) NOT NULL default '1',
16911691
`language` varchar(2) NOT NULL default 'en',
1692-
`groups` TEXT NOT NULL default '',
1692+
`groups` TEXT NOT NULL,
16931693
`default_group` int(11) unsigned NOT NULL default '0',
16941694
`client_id` int(11) unsigned NOT NULL default '0',
16951695
`id_rsa` VARCHAR( 2000 ) NOT NULL default '',
@@ -1867,7 +1867,8 @@ CREATE TABLE `web_domain` (
18671867
`rewrite_rules` mediumtext,
18681868
`added_date` date NOT NULL DEFAULT '0000-00-00',
18691869
`added_by` varchar(255) DEFAULT NULL,
1870-
PRIMARY KEY (`domain_id`)
1870+
PRIMARY KEY (`domain_id`),
1871+
UNIQUE KEY `serverdomain` ( `server_id` , `domain` )
18711872
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
18721873

18731874
-- --------------------------------------------------------

install/tpl/debian_dovecot2.conf.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ auth_mechanisms = plain login
44
disable_plaintext_auth = no
55
log_timestamp = "%Y-%m-%d %H:%M:%S "
66
mail_privileged_group = vmail
7+
postmaster_address = postmaster@example.com
78
ssl_cert = </etc/postfix/smtpd.cert
89
ssl_key = </etc/postfix/smtpd.key
910
passdb {

install/tpl/debian_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
1919
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
2020
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
2121
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
22-
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
22+
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
2323
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
2424
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
2525
smtpd_client_message_rate_limit = 100

install/tpl/fedora_postfix.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
1616
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
1717
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
1818
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
19-
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
19+
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
2020
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
2121
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
2222
smtpd_client_message_rate_limit = 100

0 commit comments

Comments
 (0)