Skip to content

Commit 7e7da4f

Browse files
author
Pascal Dreissen
committed
Merge branch 'master' into 'applemooz_master'
Master See merge request pdreissen/ispconfig3!41
2 parents acad34e + 3223915 commit 7e7da4f

32 files changed

+367
-321
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ public function configure_dovecot()
111111
}
112112
if(version_compare($dovecot_version,2.2) >= 0) {
113113
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
114-
replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0);
114+
$content = file_get_contents($config_dir.'/'.$configfile);
115+
$content = str_replace('!SSLv2','',$content);
116+
file_put_contents($config_dir.'/'.$configfile,$content);
117+
unset($content);
115118
}
116119
} else {
117120
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) {

install/dist/lib/fedora.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ public function configure_dovecot()
443443
if(version_compare($dovecot_version,2.1) < 0) {
444444
removeLine($config_dir.'/'.$configfile, 'ssl_protocols =');
445445
}
446+
if(version_compare($dovecot_version,2.2) >= 0) {
447+
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
448+
$content = file_get_contents($config_dir.'/'.$configfile);
449+
$content = str_replace('!SSLv2','',$content);
450+
file_put_contents($config_dir.'/'.$configfile,$content);
451+
unset($content);
452+
}
446453
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
447454
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
448455
} else {

install/lib/installer_base.lib.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,10 @@ public function configure_dovecot() {
13781378
}
13791379
if(version_compare($dovecot_version,2.2) >= 0) {
13801380
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
1381-
replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0);
1381+
$content = file_get_contents($config_dir.'/'.$configfile);
1382+
$content = str_replace('!SSLv2','',$content);
1383+
file_put_contents($config_dir.'/'.$configfile,$content);
1384+
unset($content);
13821385
}
13831386
}
13841387

install/patches/upd_0086.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
if(!defined('INSTALLER_RUN')) die('Patch update file access violation.');
4+
5+
/*
6+
Example installer patch update class. the classname must match
7+
the php and the sql patch update filename. The php patches are
8+
only executed when a corresponding sql patch exists.
9+
*/
10+
11+
class upd_0086 extends installer_patch_update {
12+
13+
public function onAfterSQL() {
14+
global $inst;
15+
16+
// delete all the files that were deleted on previous updates
17+
$delete = array(
18+
'interface/web/js/mail_domain_dkim.js',
19+
'interface/web/mail/mail_domain_dkim_create.php'
20+
);
21+
22+
$curpath = dirname(dirname(realpath(dirname(__FILE__))));
23+
24+
$c = 0;
25+
$del_all = false;
26+
foreach($delete as $file) {
27+
if(strpos($file, '..') !== false) continue; // security!
28+
29+
if($del_all == false) {
30+
$answer = $inst->simple_query('Delete obsolete file ' . $file . '?', array('y', 'n', 'a', 'all', 'none'), 'y');
31+
if($answer == 'n') continue;
32+
elseif($answer == 'a' || $answer == 'all') $del_all = true;
33+
elseif($answer == 'none') break;
34+
}
35+
if(@is_file('/usr/local/ispconfig/' . $file) && !@is_file($curpath . '/' . $file)) {
36+
// be sure this is not a file contained in installation!
37+
@unlink('/usr/local/ispconfig/' . $file);
38+
ilog('Deleted obsolete file /usr/local/ispconfig/' . $file);
39+
$c++;
40+
}
41+
}
42+
ilog($c . 'obsolete files deleted.');
43+
}
44+
}
45+
46+
?>

install/tpl/debian6_dovecot-sql.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':',
1919

2020
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
2121
# Do not enable it on Dovecot 1.x servers
22-
# iterate_query = SELECT email as user FROM mail_user WHERE `disable%Ls` = 'n' AND server_id = '{server_id}'
22+
# iterate_query = SELECT email as user FROM mail_user WHERE server_id = '{server_id}'

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ firewall=bastille
1616
loglevel=2
1717
admin_notify_events=1
1818
backup_dir=/var/backup
19+
backup_tmp=/tmp
1920
backup_dir_is_mount=n
2021
backup_mode=rootgz
2122
backup_time=0:00

install/tpl/system.ini.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ mailbox_show_backup_tab=y
1515
mailboxlist_webmail_link=y
1616
webmail_url=/webmail
1717
dkim_path=/var/lib/amavis/dkim
18+
smtp_enabled=y
19+
smtp_host=localhost
1820

1921
[monitor]
2022

interface/lib/classes/functions.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'a
5858
if($cc != '') $app->ispcmail->setHeader('Cc', $cc);
5959
if($bcc != '') $app->ispcmail->setHeader('Bcc', $bcc);
6060

61+
if(is_string($to) && strpos($to, ',') !== false) {
62+
$to = preg_split('/\s*,\s*/', $to);
63+
}
64+
6165
$app->ispcmail->send($to);
6266
$app->ispcmail->finish();
6367

interface/lib/classes/validate_client.inc.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,8 @@ function check_vat_id ($field_name, $field_value, $validator){
174174
}
175175
}
176176
}
177-
178-
$client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");
179-
180-
if($client){
177+
try {
178+
$client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");
181179
$params = array('countryCode' => $cc, 'vatNumber' => $vn);
182180
try{
183181
$r = $client->checkVat($params);
@@ -191,12 +189,12 @@ function check_vat_id ($field_name, $field_value, $validator){
191189
}
192190
}
193191

194-
// This foreach shows every single line of the returned information
195-
/*
196-
foreach($r as $k=>$prop){
197-
echo $k . ': ' . $prop;
198-
}
199-
*/
192+
// This foreach shows every single line of the returned information
193+
/*
194+
foreach($r as $k=>$prop){
195+
echo $k . ': ' . $prop;
196+
}
197+
*/
200198

201199
} catch(SoapFault $e) {
202200
//echo 'Error, see message: '.$e->faultstring;
@@ -217,7 +215,7 @@ function check_vat_id ($field_name, $field_value, $validator){
217215
break;
218216
}
219217
}
220-
} else {
218+
} catch(SoapFault $e){
221219
// Connection to host not possible, europe.eu down?
222220
// this shouldn't be the user's fault, so we return no error
223221
}

interface/web/admin/form/server_config.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,20 @@
183183
'width' => '40',
184184
'maxlength' => '255'
185185
),
186+
'backup_tmp' => array(
187+
'datatype' => 'VARCHAR',
188+
'formtype' => 'TEXT',
189+
'default' => '/tmp/',
190+
'validators' => array( 0 => array('type' => 'NOTEMPTY',
191+
'errmsg' => 'tmpdir_path_error_empty'),
192+
1 => array ( 'type' => 'REGEX',
193+
'regex' => "/^\/[a-zA-Z0-9\.\-\_\/]{4,128}$/",
194+
'errmsg'=> 'tmpdir_path_error_regex'),
195+
),
196+
'value' => '',
197+
'width' => '40',
198+
'maxlength' => '255'
199+
),
186200
'backup_dir_is_mount' => array(
187201
'datatype' => 'VARCHAR',
188202
'formtype' => 'CHECKBOX',

0 commit comments

Comments
 (0)