Skip to content

Commit ba747c0

Browse files
committed
Enhanced getmail support and the installer.
1 parent 32b40db commit ba747c0

File tree

19 files changed

+418
-217
lines changed

19 files changed

+418
-217
lines changed

install/install.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@
8686
swriteln('Configuring Amavisd');
8787
$inst->configure_amavis();
8888

89-
// Configure Amavis
89+
// Configure Getmail
90+
swriteln('Configuring Getmail');
91+
$inst->configure_getmail();
92+
93+
// Configure ISPConfig
9094
swriteln('Installing ISPConfig');
9195
$inst->install_ispconfig();
9296

@@ -101,11 +105,19 @@
101105
amavisd
102106
calmd
103107
spamd
104-
105-
106-
107108
*/
108109

110+
exec("/etc/init.d/mysql restart");
111+
exec("/etc/init.d/postfix restart");
112+
exec("/etc/init.d/saslauthd restart");
113+
exec("/etc/init.d/amavis restart");
114+
exec("/etc/init.d/clamav-daemon restart");
115+
exec("/etc/init.d/courier-authdaemon restart");
116+
exec("/etc/init.d/courier-imap restart");
117+
exec("/etc/init.d/courier-imap-ssl restart");
118+
exec("/etc/init.d/courier-pop restart");
119+
exec("/etc/init.d/courier-pop-ssl restart");
120+
109121

110122
echo "Installation finished.\n";
111123

install/lib/installer_base.lib.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,16 @@ function configure_spamassassin() {
439439
wf($configfile,$content);
440440
}
441441

442+
function configure_getmail() {
443+
global $conf;
444+
445+
$command = "useradd -b /etc/getmail -d /etc/getmail getmail";
446+
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
447+
448+
$command = "chmod -R 700 /etc/getmail";
449+
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
450+
}
451+
442452

443453
function install_ispconfig() {
444454
global $conf;
@@ -466,7 +476,7 @@ function install_ispconfig() {
466476
$command = "ln -s ".$conf["ispconfig_install_dir"]."/interface/web/ /var/www/ispconfig";
467477
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
468478

469-
// Create the config file for ISPConfig
479+
// Create the config file for ISPConfig interface
470480
$configfile = 'config.inc.php';
471481
if(is_file($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile)) copy($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile,$conf["ispconfig_install_dir"].'/interface/lib/'.$configfile.'~');
472482
$content = rf("tpl/".$configfile.".master");
@@ -476,6 +486,17 @@ function install_ispconfig() {
476486
$content = str_replace('{mysql_server_host}',$conf["mysql_server_host"],$content);
477487
wf($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile,$content);
478488

489+
// Create the config file for ISPConfig server
490+
$configfile = 'config.inc.php';
491+
if(is_file($conf["ispconfig_install_dir"].'/server/lib/'.$configfile)) copy($conf["ispconfig_install_dir"].'/server/lib/'.$configfile,$conf["ispconfig_install_dir"].'/interface/lib/'.$configfile.'~');
492+
$content = rf("tpl/".$configfile.".master");
493+
$content = str_replace('{mysql_server_ispconfig_user}',$conf["mysql_server_ispconfig_user"],$content);
494+
$content = str_replace('{mysql_server_ispconfig_password}',$conf["mysql_server_ispconfig_password"],$content);
495+
$content = str_replace('{mysql_server_database}',$conf["mysql_server_database"],$content);
496+
$content = str_replace('{mysql_server_host}',$conf["mysql_server_host"],$content);
497+
wf($conf["ispconfig_install_dir"].'/server/lib/'.$configfile,$content);
498+
499+
479500
// Chmod the files
480501
$command = "chmod -R 750 ".$conf["ispconfig_install_dir"];
481502
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
@@ -491,6 +512,9 @@ function install_ispconfig() {
491512
$command = "adduser www-data ispconfig";
492513
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
493514

515+
// Make the shell scripts executable
516+
$command = "chmod +x ".$conf["ispconfig_install_dir"]."/server/scripts/*.sh";
517+
caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command);
494518

495519
}
496520

install/tpl/config.inc.php.master

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ ini_set('register_globals',0);
3535

3636
$conf["app_title"] = "ISPConfig";
3737
$conf["app_version"] = "3.0.0";
38+
$conf["server_id"] = "1";
3839

3940

4041
/*
@@ -69,6 +70,13 @@ define("DB_DATABASE",$conf["db_database"]);
6970
define("DB_USER",$conf["db_user"]);
7071
define("DB_PASSWORD",$conf["db_password"]);
7172

73+
/*
74+
Logging
75+
*/
76+
77+
$conf["log_file"] = $conf["rootpath"].$conf["fs_div"]."ispconfig.log";
78+
$conf["log_priority"] = 0; // 0 = Debug, 1 = Warning, 2 = Error
79+
7280
/*
7381
Themes
7482
*/
@@ -104,4 +112,8 @@ $conf["default_retry"] = 7200;
104112
$conf["default_expire"] = 604800;
105113
$conf["default_minimum_ttl"] = 86400;
106114

115+
define("LOGLEVEL_DEBUG",0);
116+
define("LOGLEVEL_WARN",1);
117+
define("LOGLEVEL_ERROR",2);
118+
107119
?>

install/uninstall.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
require("/usr/local/ispconfig/server/lib/config.inc.php");
32+
require("/usr/local/ispconfig/server/lib/app.inc.php");
33+
34+
// Delete the ISPConfig database
35+
$app->db->query('DROP DATABASE '.$conf["db_database"]);
36+
37+
// Deleting the symlink in /var/www
38+
unlink("/var/www/ispconfig");
39+
40+
// Delete the ispconfig files
41+
exec('rm -rf /usr/local/ispconfig');
42+
43+
echo "Finished.\n";
44+
45+
?>

interface/lib/classes/tform.inc.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -875,14 +875,17 @@ function datalogSave($action,$primary_id,$record_new) {
875875
}
876876

877877
function getAuthSQL($perm) {
878-
879-
$sql = '(';
880-
$sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR ";
881-
$sql .= "(sys_groupid IN (".$_SESSION["s"]["user"]["groups"].") AND sys_perm_group like '%$perm%') OR ";
882-
$sql .= "sys_perm_other like '%$perm%'";
883-
$sql .= ')';
884-
885-
return $sql;
878+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
879+
return '1';
880+
} else {
881+
$sql = '(';
882+
$sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR ";
883+
$sql .= "(sys_groupid IN (".$_SESSION["s"]["user"]["groups"].") AND sys_perm_group like '%$perm%') OR ";
884+
$sql .= "sys_perm_other like '%$perm%'";
885+
$sql .= ')';
886+
887+
return $sql;
888+
}
886889
}
887890

888891
/*

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,29 @@
123123
);
124124

125125

126+
$form["tabs"]['config'] = array (
127+
'title' => "Config",
128+
'width' => 100,
129+
'template' => "templates/server_edit_config.htm",
130+
'fields' => array (
131+
##################################
132+
# Begin Datatable fields
133+
##################################
134+
'config' => array (
135+
'datatype' => 'TEXT',
136+
'formtype' => 'TEXTAREA',
137+
'default' => '',
138+
'value' => '',
139+
'width' => '',
140+
'cols' => '40',
141+
'rows' => '20',
142+
'maxlength' => ''
143+
),
144+
##################################
145+
# ENDE Datatable fields
146+
##################################
147+
)
148+
);
149+
150+
126151
?>
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<?php
2-
$wb["server_name_txt"] = 'Servername';
3-
$wb["mail_server_txt"] = 'Mailserver';
4-
$wb["web_server_txt"] = 'Webserver';
5-
$wb["dns_server_txt"] = 'DNS-Server';
6-
$wb["file_server_txt"] = 'Fileserver';
7-
$wb["db_server_txt"] = 'DB-Server';
8-
$wb["vserver_server_txt"] = 'VServer-Server';
9-
$wb["active_txt"] = 'Active';
10-
$wb["btn_save_txt"] = 'Save';
11-
$wb["btn_cancel_txt"] = 'Cancel';
1+
<?php
2+
$wb["config_txt"] = 'config';
3+
$wb["btn_save_txt"] = 'Save';
4+
$wb["btn_cancel_txt"] = 'Cancel';
5+
$wb["server_name_txt"] = 'Servername';
6+
$wb["mail_server_txt"] = 'Mailserver';
7+
$wb["web_server_txt"] = 'Webserver';
8+
$wb["dns_server_txt"] = 'DNS-Server';
9+
$wb["file_server_txt"] = 'Fileserver';
10+
$wb["db_server_txt"] = 'DB-Server';
11+
$wb["vserver_server_txt"] = 'VServer-Server';
12+
$wb["active_txt"] = 'Active';
1213
?>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<table width="500" border="0" cellspacing="0" cellpadding="2">
2+
<tr>
3+
<td class="frmText11">{tmpl_var name='config_txt'}:</td>
4+
<td class="frmText11"><textarea name='config' cols='60' rows='30'>{tmpl_var name='config'}</textarea></td>
5+
</tr> <tr>
6+
<td class="frmText11">&nbsp;</td>
7+
<td class="frmText11">&nbsp;</td>
8+
</tr>
9+
<tr>
10+
<td>&nbsp;</td>
11+
<td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_edit.php');"><div class="buttonEnding"></div>&nbsp;
12+
<input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_list.php');"><div class="buttonEnding"></div>
13+
</td>
14+
</tr>
15+
</table>
16+
<input type="hidden" name="id" value="{tmpl_var name='id'}">

interface/web/client/templates/client_edit_limits.htm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
<td class="frmText11">{tmpl_var name='limit_mailrouting_txt'}:</td>
3535
<td class="frmText11"><input name="limit_mailrouting" type="text" class="text" value="{tmpl_var name='limit_mailrouting'}" size="10" maxlength="10"></td>
3636
</tr>
37+
<!--
3738
<tr>
3839
<td class="frmText11">{tmpl_var name='limit_mailfilter_txt'}:</td>
3940
<td class="frmText11"><input name="limit_mailfilter" type="text" class="text" value="{tmpl_var name='limit_mailfilter'}" size="10" maxlength="10"></td>
4041
</tr>
42+
-->
4143
<tr>
4244
<td class="frmText11">{tmpl_var name='limit_fetchmail_txt'}:</td>
4345
<td class="frmText11"><input name="limit_fetchmail" type="text" class="text" value="{tmpl_var name='limit_fetchmail'}" size="10" maxlength="10"></td>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<?php
2-
$wb["server_id_txt"] = 'server_id';
3-
$wb["type_txt"] = 'type';
4-
$wb["source_server_txt"] = 'source_server';
5-
$wb["source_username_txt"] = 'source_username';
6-
$wb["source_password_txt"] = 'source_password';
7-
$wb["source_delete_txt"] = 'source_delete';
8-
$wb["destination_txt"] = 'destination';
9-
$wb["active_txt"] = 'active';
10-
$wb["btn_save_txt"] = 'Save';
11-
$wb["btn_cancel_txt"] = 'Cancel';
1+
<?php
2+
$wb["server_id_txt"] = 'Server';
3+
$wb["type_txt"] = 'Type';
4+
$wb["source_server_txt"] = 'Pop3/Imap Server';
5+
$wb["source_username_txt"] = 'Username';
6+
$wb["source_password_txt"] = 'Password';
7+
$wb["source_delete_txt"] = 'Delete emails after retrieval';
8+
$wb["destination_txt"] = 'Destination';
9+
$wb["active_txt"] = 'Active';
10+
$wb["btn_save_txt"] = 'Save';
11+
$wb["btn_cancel_txt"] = 'Cancel';
1212
?>

0 commit comments

Comments
 (0)