Skip to content

Commit 31ed6c6

Browse files
committed
Email catchall and forward
1 parent 3c11b08 commit 31ed6c6

30 files changed

+922
-17
lines changed

interface/lib/classes/listform.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getSearchSQL($sql_where = "") {
7777
if(is_array($i['value'])) {
7878
$out = '<option value=""></option>';
7979
foreach($i['value'] as $k => $v) {
80-
$selected = ($k == $_SESSION["search"][$list_name][$search_prefix.$field])?' SELECTED':'';
80+
$selected = ($k == $_SESSION["search"][$list_name][$search_prefix.$field] && $_SESSION["search"][$list_name][$search_prefix.$field] != '')?' SELECTED':'';
8181
$out .= "<option value='$k'$selected>$v</option>\r\n";
8282
}
8383
}

interface/sql/ispconfig3db.sql

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# http://www.phpmyadmin.net/ (download page)
44
#
55
# Host: localhost
6-
# Erstellungszeit: 24. November 2005 um 00:31
6+
# Erstellungszeit: 24. November 2005 um 23:49
77
# Server Version: 4.0.23
88
# PHP-Version: 5.0.3
99
# Datenbank: `ispconfig3`
@@ -104,11 +104,16 @@ INSERT INTO mail_domain VALUES (2, 1, 0, 'riud', 'riud', '', 1, 'test2.de', 'ali
104104

105105
DROP TABLE IF EXISTS mail_domain_catchall;
106106
CREATE TABLE mail_domain_catchall (
107-
virtual_default_id int(11) NOT NULL auto_increment,
107+
domain_catchall_id int(11) NOT NULL auto_increment,
108+
sys_userid int(11) NOT NULL default '0',
109+
sys_groupid int(11) NOT NULL default '0',
110+
sys_perm_user varchar(5) NOT NULL default '',
111+
sys_perm_group varchar(5) NOT NULL default '',
112+
sys_perm_other varchar(5) NOT NULL default '',
108113
server_id int(11) NOT NULL default '0',
109114
domain varchar(255) NOT NULL default '',
110-
dest varchar(255) NOT NULL default '',
111-
PRIMARY KEY (virtual_default_id),
115+
destination varchar(255) NOT NULL default '',
116+
PRIMARY KEY (domain_catchall_id),
112117
KEY server_id (server_id,domain)
113118
) TYPE=MyISAM;
114119

@@ -168,7 +173,7 @@ CREATE TABLE mail_mailman_domain (
168173

169174
DROP TABLE IF EXISTS mail_redirect;
170175
CREATE TABLE mail_redirect (
171-
email_id int(11) NOT NULL auto_increment,
176+
redirect_id int(11) NOT NULL auto_increment,
172177
sys_userid int(11) NOT NULL default '0',
173178
sys_groupid int(11) NOT NULL default '0',
174179
sys_perm_user varchar(5) NOT NULL default '',
@@ -178,15 +183,17 @@ CREATE TABLE mail_redirect (
178183
email varchar(255) NOT NULL default '',
179184
destination varchar(255) NOT NULL default '',
180185
type enum('alias','forward') NOT NULL default 'alias',
181-
enabled enum('yes','no') NOT NULL default 'yes',
182-
PRIMARY KEY (email_id),
186+
active enum('0','1') NOT NULL default '1',
187+
PRIMARY KEY (redirect_id),
183188
KEY server_id (server_id,email)
184189
) TYPE=MyISAM;
185190

186191
#
187192
# Daten für Tabelle `mail_redirect`
188193
#
189194

195+
INSERT INTO mail_redirect VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'tom@test.de', 'till@test.de', 'alias', '1');
196+
INSERT INTO mail_redirect VALUES (2, 1, 0, 'riud', 'riud', '', 1, 'hallo@test.de', 't.brehm@ensign.de', 'forward', '1');
190197
# --------------------------------------------------------
191198

192199
#
@@ -332,6 +339,8 @@ INSERT INTO sys_datalog VALUES (25, 'mail_box', 'mailbox_id:1', 'u', 1132787761,
332339
INSERT INTO sys_datalog VALUES (26, 'mail_box', 'mailbox_id:0', 'i', 1132787775, 'admin', 'a:3:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:12:"test@test.de";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}');
333340
INSERT INTO sys_datalog VALUES (27, 'mail_box', 'mailbox_id:1', 'u', 1132788121, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}');
334341
INSERT INTO sys_datalog VALUES (28, 'mail_box', 'mailbox_id:1', 'u', 1132788482, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}');
342+
INSERT INTO sys_datalog VALUES (29, 'mail_redirect', 'redirect_id:0', 'i', 1132859789, 'admin', 'a:5:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:11:"tom@test.de";}s:11:"destination";a:2:{s:3:"old";N;s:3:"new";s:12:"till@test.de";}s:4:"type";a:2:{s:3:"old";N;s:3:"new";s:5:"alias";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}');
343+
INSERT INTO sys_datalog VALUES (30, 'mail_redirect', 'redirect_id:0', 'i', 1132868928, 'admin', 'a:5:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:13:"hallo@test.de";}s:11:"destination";a:2:{s:3:"old";N;s:3:"new";s:17:"t.brehm@ensign.de";}s:4:"type";a:2:{s:3:"old";N;s:3:"new";s:7:"forward";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}');
335344
# --------------------------------------------------------
336345

337346
#

interface/web/sites/form/mail_alias.tform.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
'formtype' => 'TEXT',
7272
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
7373
'errmsg'=> 'email_error_isemail'),
74-
1 => array ( 'type' => 'UNIQUE',
75-
'errmsg'=> 'email_error_unique'),
7674
),
7775
'default' => '',
7876
'value' => '',
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Email Catchall";
37+
$form["description"] = "";
38+
$form["name"] = "mail_domain_catchall";
39+
$form["action"] = "mail_domain_catchall_edit.php";
40+
$form["db_table"] = "mail_domain_catchall";
41+
$form["db_table_idx"] = "domain_catchall_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "catchall";
44+
$form["list_default"] = "mail_domain_catchall_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['catchall'] = array (
54+
'title' => "Domain Catchall",
55+
'width' => 150,
56+
'template' => "templates/mail_domain_catchall_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'VARCHAR',
64+
'default' => '',
65+
'value' => ''
66+
),
67+
'domain' => array (
68+
'datatype' => 'VARCHAR',
69+
'formtype' => 'SELECT',
70+
'validators' => array ( 0 => array ( 'type' => 'UNIQUE',
71+
'errmsg'=> 'domain_error_unique'),
72+
),
73+
'datasource' => array ( 'type' => 'SQL',
74+
'querystring' => "SELECT domain FROM mail_domain WHERE type = 'local' ORDER BY domain",
75+
'keyfield'=> 'domain',
76+
'valuefield'=> 'domain'
77+
),
78+
'default' => '',
79+
'value' => '',
80+
'width' => '30',
81+
'maxlength' => '255'
82+
),
83+
'destination' => array (
84+
'datatype' => 'VARCHAR',
85+
'formtype' => 'TEXT',
86+
'default' => '',
87+
'value' => '',
88+
'width' => '30',
89+
'maxlength' => '255'
90+
),
91+
'active' => array (
92+
'datatype' => 'INTEGER',
93+
'formtype' => 'CHECKBOX',
94+
'default' => '1',
95+
'value' => '1'
96+
),
97+
##################################
98+
# ENDE Datatable fields
99+
##################################
100+
)
101+
);
102+
103+
104+
?>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Email Forward";
37+
$form["description"] = "";
38+
$form["name"] = "mail_forward";
39+
$form["action"] = "mail_forward_edit.php";
40+
$form["db_table"] = "mail_redirect";
41+
$form["db_table_idx"] = "redirect_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "forward";
44+
$form["list_default"] = "mail_forward_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['forward'] = array (
54+
'title' => "Email forward",
55+
'width' => 100,
56+
'template' => "templates/mail_forward_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'TEXT',
64+
'default' => '',
65+
'value' => '',
66+
'width' => '30',
67+
'maxlength' => '255'
68+
),
69+
'email' => array (
70+
'datatype' => 'VARCHAR',
71+
'formtype' => 'TEXT',
72+
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
73+
'errmsg'=> 'email_error_isemail'),
74+
),
75+
'default' => '',
76+
'value' => '',
77+
'width' => '30',
78+
'maxlength' => '255'
79+
),
80+
'destination' => array (
81+
'datatype' => 'VARCHAR',
82+
'formtype' => 'TEXT',
83+
'default' => '',
84+
'value' => '',
85+
'width' => '30',
86+
'maxlength' => '255'
87+
),
88+
'type' => array (
89+
'datatype' => 'VARCHAR',
90+
'formtype' => 'SELECT',
91+
'default' => '',
92+
'value' => array('forward'=>'Forward','alias' => 'Alias')
93+
),
94+
'active' => array (
95+
'datatype' => 'INTEGER',
96+
'formtype' => 'CHECKBOX',
97+
'default' => '1',
98+
'value' => '1'
99+
),
100+
##################################
101+
# ENDE Datatable fields
102+
##################################
103+
)
104+
);
105+
106+
107+
108+
?>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
$wb["email_txt"] = 'Email';
3+
$wb["destination_txt"] = 'Destination';
4+
$wb["active_txt"] = 'Active';
5+
$wb["btn_save_txt"] = 'Save';
6+
$wb["btn_cancel_txt"] = 'Cancel';
7+
$wb["email_error_isemail"] = 'Emailaddress is empty.';
8+
$wb["email_error_unique"] = 'Duplicate Emailaddress.';
9+
$wb["no_domain_perm"] = "You have no permission for this domain.";
10+
?>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
2-
$wb["list_head_txt"] = 'mail_alias';
3-
$wb["email_txt"] = 'email';
4-
$wb["destination_txt"] = 'destination';
2+
$wb["list_head_txt"] = 'Email Alias';
3+
$wb["email_txt"] = 'Email';
4+
$wb["destination_txt"] = 'Destination';
55
$wb["page_txt"] = 'Page';
66
$wb["page_of_txt"] = 'of';
77
$wb["page_next_txt"] = 'Next';
88
$wb["page_back_txt"] = 'Back';
99
$wb["delete_txt"] = 'Delete';
1010
$wb["filter_txt"] = 'Filter';
11+
$wb["add_new_record_txt"] = 'Add new Email alias';
12+
$wb["active_txt"] = 'Active';
1113
?>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
$wb["server_id_txt"] = 'server_id';
3+
$wb["domain_txt"] = 'domain';
4+
$wb["destination_txt"] = 'destination';
5+
$wb["active_txt"] = 'active';
6+
$wb["btn_save_txt"] = 'Save';
7+
$wb["btn_cancel_txt"] = 'Cancel';
8+
?>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Email Catchall';
3+
$wb["server_id_txt"] = 'Server';
4+
$wb["domain_txt"] = 'Domain';
5+
$wb["destination_txt"] = 'Destination email address';
6+
$wb["page_txt"] = 'Page';
7+
$wb["page_of_txt"] = 'of';
8+
$wb["page_next_txt"] = 'Next';
9+
$wb["page_back_txt"] = 'Back';
10+
$wb["delete_txt"] = 'Delete';
11+
$wb["filter_txt"] = 'Filter';
12+
$wb["add_new_record_txt"] = 'Add new Catchall';
13+
?>

interface/web/sites/lib/lang/en_mail_domain_list.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$wb["list_head_txt"] = 'Email Domains';
2+
$wb["list_head_txt"] = 'Email Domain';
33
$wb["server_id_txt"] = 'Server';
44
$wb["domain_txt"] = 'Domain';
55
$wb["page_txt"] = 'Page';

0 commit comments

Comments
 (0)