Skip to content

Commit 3d229b0

Browse files
committed
Added: FS#613 - Add email domain aliases
1 parent 35a8f56 commit 3d229b0

17 files changed

+624
-55
lines changed

install/sql/ispconfig3.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ CREATE TABLE `client` (
6969
`limit_maildomain` int(11) NOT NULL default '-1',
7070
`limit_mailbox` int(11) NOT NULL default '-1',
7171
`limit_mailalias` int(11) NOT NULL default '-1',
72+
`limit_mailaliasdomain` int(11) NOT NULL default '-1',
7273
`limit_mailforward` int(11) NOT NULL default '-1',
7374
`limit_mailcatchall` int(11) NOT NULL default '-1',
7475
`limit_mailrouting` int(11) NOT NULL default '0',
@@ -125,6 +126,7 @@ CREATE TABLE `client_template` (
125126
`limit_maildomain` int(11) NOT NULL default '-1',
126127
`limit_mailbox` int(11) NOT NULL default '-1',
127128
`limit_mailalias` int(11) NOT NULL default '-1',
129+
`limit_mailaliasdomain` int(11) NOT NULL default '-1',
128130
`limit_mailforward` int(11) NOT NULL default '-1',
129131
`limit_mailcatchall` int(11) NOT NULL default '-1',
130132
`limit_mailrouting` int(11) NOT NULL default '0',
@@ -389,7 +391,7 @@ CREATE TABLE `mail_forwarding` (
389391
`server_id` int(11) unsigned NOT NULL default '0',
390392
`source` varchar(255) NOT NULL,
391393
`destination` text NOT NULL default '',
392-
`type` enum('alias','forward','catchall') NOT NULL default 'alias',
394+
`type` enum('alias','aliasdomain','forward','catchall') NOT NULL default 'alias',
393395
`active` enum('n','y') NOT NULL,
394396
PRIMARY KEY (`forwarding_id`),
395397
KEY `server_id` (`server_id`,`source`)

interface/web/client/form/client.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,20 @@
364364
'rows' => '',
365365
'cols' => ''
366366
),
367+
'limit_mailaliasdomain' => array (
368+
'datatype' => 'INTEGER',
369+
'formtype' => 'TEXT',
370+
'validators' => array ( 0 => array ( 'type' => 'ISINT',
371+
'errmsg'=> 'limit_mailaliasdomain_error_notint'),
372+
),
373+
'default' => '-1',
374+
'value' => '',
375+
'separator' => '',
376+
'width' => '10',
377+
'maxlength' => '10',
378+
'rows' => '',
379+
'cols' => ''
380+
),
367381
'limit_mailforward' => array (
368382
'datatype' => 'INTEGER',
369383
'formtype' => 'TEXT',

interface/web/client/form/client_template.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,20 @@
143143
'rows' => '',
144144
'cols' => ''
145145
),
146+
'limit_mailaliasdomain' => array (
147+
'datatype' => 'INTEGER',
148+
'formtype' => 'TEXT',
149+
'validators' => array ( 0 => array ( 'type' => 'ISINT',
150+
'errmsg'=> 'limit_mailaliasdomain_error_notint'),
151+
),
152+
'default' => '-1',
153+
'value' => '',
154+
'separator' => '',
155+
'width' => '10',
156+
'maxlength' => '10',
157+
'rows' => '',
158+
'cols' => ''
159+
),
146160
'limit_mailforward' => array (
147161
'datatype' => 'INTEGER',
148162
'formtype' => 'TEXT',

interface/web/client/lib/lang/en_client.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
33
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
44
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
5+
$wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases';
56
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
67
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
78
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
@@ -61,6 +62,7 @@ $wb["username_error_unique"] = 'The username must be unique.';
6162
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
6263
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
6364
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
65+
$wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.';
6466
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
6567
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
6668
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
1-
<?php
2-
3-
$wb["limit_client_error_notint"] = 'Client Limit is not a number.';
4-
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
5-
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
6-
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
7-
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
8-
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
9-
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
10-
$wb["limit_mailfilter_txt"] = 'Max. number of email filters';
11-
$wb["limit_fetchmail_txt"] = 'Max. number of fetchmail accounts';
12-
$wb["limit_mailquota_txt"] = 'Mailbox quota';
13-
$wb["limit_spamfilter_wblist_txt"] = 'Max. number of spamfilter white / blacklist filters';
14-
$wb["limit_spamfilter_user_txt"] = 'Max. number of spamfilter users';
15-
$wb["limit_spamfilter_policy_txt"] = 'Max. number of spamfilter policys';
16-
$wb["limit_domain_txt"] = 'limit_domain';
17-
$wb["limit_subdomain_txt"] = 'limit_subdomain';
18-
$wb["limit_webquota_txt"] = 'limit_webquota';
19-
$wb["limit_database_txt"] = 'limit_database';
20-
$wb["limit_cron_txt"] = 'Max. number of cron jobs';
21-
$wb["limit_cron_type_txt"] = 'Max. type of cron jobs (chrooted and full implies url)';
22-
$wb["limit_cron_frequency_txt"] = 'Min. delay between executions';
23-
$wb["limit_web_domain_txt"] = 'Max. number of web domains';
24-
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
25-
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
26-
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
27-
$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
28-
$wb["limit_dns_record_txt"] = 'Max. number DNS records';
29-
$wb["limit_shell_user_txt"] = 'Max. number of Shell users';
30-
$wb["limit_client_txt"] = 'Max. number of Clients';
31-
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
32-
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
33-
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
34-
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
35-
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
36-
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
37-
$wb["limit_mailfilter_error_notint"] = 'The email filter limit must be a number.';
38-
$wb["limit_mailfetchmail_error_notint"] = 'The fetchmail limit must be a number.';
39-
$wb["limit_mailquota_error_notint"] = 'The email quota limit must be a number.';
40-
$wb["limit_spamfilter_wblist_error_notint"] = 'The spamfilter white / blacklist limit must be a number.';
41-
$wb["limit_spamfilter_user_error_notint"] = 'The spamfilter user limit must be a number.';
42-
$wb["limit_spamfilter_policy_error_notint"] = 'The spamfilter policy limit must be a number.';
43-
$wb["limit_web_domain_error_notint"] = 'The website limit must be a number.';
44-
$wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must be a number.';
45-
$wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.';
46-
$wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.';
47-
$wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.';
48-
$wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.';
49-
$wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.';
50-
$wb["limit_database_txt"] = 'Max. number of Databases';
51-
$wb["limit_database_error_notint"] = 'The database limit must be a number.';
52-
$wb["limit_cron_error_notint"] = 'The cron limit must be a number.';
53-
$wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.';
54-
$wb["error_template_name_empty"] = 'Please enter a Template name';
1+
<?php
2+
3+
$wb["limit_client_error_notint"] = 'Client Limit is not a number.';
4+
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
5+
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
6+
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
7+
$wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases';
8+
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
9+
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
10+
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
11+
$wb["limit_mailfilter_txt"] = 'Max. number of email filters';
12+
$wb["limit_fetchmail_txt"] = 'Max. number of fetchmail accounts';
13+
$wb["limit_mailquota_txt"] = 'Mailbox quota';
14+
$wb["limit_spamfilter_wblist_txt"] = 'Max. number of spamfilter white / blacklist filters';
15+
$wb["limit_spamfilter_user_txt"] = 'Max. number of spamfilter users';
16+
$wb["limit_spamfilter_policy_txt"] = 'Max. number of spamfilter policys';
17+
$wb["limit_domain_txt"] = 'limit_domain';
18+
$wb["limit_subdomain_txt"] = 'limit_subdomain';
19+
$wb["limit_webquota_txt"] = 'limit_webquota';
20+
$wb["limit_database_txt"] = 'limit_database';
21+
$wb["limit_cron_txt"] = 'Max. number of cron jobs';
22+
$wb["limit_cron_type_txt"] = 'Max. type of cron jobs (chrooted and full implies url)';
23+
$wb["limit_cron_frequency_txt"] = 'Min. delay between executions';
24+
$wb["limit_web_domain_txt"] = 'Max. number of web domains';
25+
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
26+
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
27+
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
28+
$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
29+
$wb["limit_dns_record_txt"] = 'Max. number DNS records';
30+
$wb["limit_shell_user_txt"] = 'Max. number of Shell users';
31+
$wb["limit_client_txt"] = 'Max. number of Clients';
32+
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
33+
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
34+
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
35+
$wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.';
36+
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
37+
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
38+
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
39+
$wb["limit_mailfilter_error_notint"] = 'The email filter limit must be a number.';
40+
$wb["limit_mailfetchmail_error_notint"] = 'The fetchmail limit must be a number.';
41+
$wb["limit_mailquota_error_notint"] = 'The email quota limit must be a number.';
42+
$wb["limit_spamfilter_wblist_error_notint"] = 'The spamfilter white / blacklist limit must be a number.';
43+
$wb["limit_spamfilter_user_error_notint"] = 'The spamfilter user limit must be a number.';
44+
$wb["limit_spamfilter_policy_error_notint"] = 'The spamfilter policy limit must be a number.';
45+
$wb["limit_web_domain_error_notint"] = 'The website limit must be a number.';
46+
$wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must be a number.';
47+
$wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.';
48+
$wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.';
49+
$wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.';
50+
$wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.';
51+
$wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.';
52+
$wb["limit_database_txt"] = 'Max. number of Databases';
53+
$wb["limit_database_error_notint"] = 'The database limit must be a number.';
54+
$wb["limit_cron_error_notint"] = 'The cron limit must be a number.';
55+
$wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.';
56+
$wb["error_template_name_empty"] = 'Please enter a Template name';
5557
?>

interface/web/client/templates/client_edit_limits.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ <h2><tmpl_var name="list_head_txt"></h2>
5353
<label for="limit_mailalias">{tmpl_var name='limit_mailalias_txt'}</label>
5454
<input name="limit_mailalias" id="limit_mailalias" value="{tmpl_var name='limit_mailalias'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
5555
</div>
56+
<div class="ctrlHolder">
57+
<label for="limit_mailaliasdomain">{tmpl_var name='limit_mailaliasdomain_txt'}</label>
58+
<input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
59+
</div>
5660
<div class="ctrlHolder">
5761
<label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label>
5862
<input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />

interface/web/client/templates/client_template_edit_limits.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ <h2><tmpl_var name="list_head_txt"></h2>
1818
<input name="limit_mailalias" id="limit_mailalias" value="{tmpl_var name='limit_mailalias'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
1919
</div>
2020
<div class="ctrlHolder">
21+
<label for="limit_mailaliasdomain">{tmpl_var name='limit_mailaliasdomain_txt'}</label>
22+
<input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
23+
</div>
24+
<div class="ctrlHolder">
2125
<label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label>
2226
<input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
2327
</div>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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"] = "Domain Alias";
37+
$form["description"] = "";
38+
$form["name"] = "mail_aliasdomain";
39+
$form["action"] = "mail_aliasdomain_edit.php";
40+
$form["db_table"] = "mail_forwarding";
41+
$form["db_table_idx"] = "forwarding_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "alias";
44+
$form["list_default"] = "mail_aliasdomain_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"]['alias'] = array (
54+
'title' => "Domain Alias",
55+
'width' => 100,
56+
'template' => "templates/mail_aliasdomain_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+
'source' => array (
70+
'datatype' => 'VARCHAR',
71+
'formtype' => 'TEXT',
72+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
73+
'errmsg'=> 'source_error_empty'),
74+
1 => array ( 'type' => 'UNIQUE',
75+
'errmsg'=> 'source_error_unique'),
76+
2 => array ( 'type' => 'REGEX',
77+
'regex' => '/^\@[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
78+
'errmsg'=> 'source_error_regex'),
79+
),
80+
'default' => '',
81+
'value' => '',
82+
'width' => '30',
83+
'maxlength' => '255'
84+
),
85+
'destination' => array (
86+
'datatype' => 'VARCHAR',
87+
'formtype' => 'TEXT',
88+
'default' => '',
89+
'value' => '',
90+
'width' => '30',
91+
'maxlength' => '255'
92+
),
93+
'type' => array (
94+
'datatype' => 'VARCHAR',
95+
'formtype' => 'SELECT',
96+
'default' => '',
97+
'value' => array('alias' => 'Alias','forward'=>'Forward')
98+
),
99+
'active' => array (
100+
'datatype' => 'VARCHAR',
101+
'formtype' => 'CHECKBOX',
102+
'default' => 'y',
103+
'value' => array(0 => 'n',1 => 'y')
104+
),
105+
##################################
106+
# ENDE Datatable fields
107+
##################################
108+
)
109+
);
110+
111+
112+
113+
?>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
$wb["source_txt"] = 'Source';
3+
$wb["destination_txt"] = 'Destination';
4+
$wb["active_txt"] = 'Active';
5+
$wb["no_domain_perm"] = "You have no permission for this domain.";
6+
$wb["limit_mailaliasdomain_txt"] = 'The max. number of email alias domains for your account is reached.';
7+
$wb["source_destination_identical_txt"] = 'Source and target Domain are the same.';
8+
$wb["source_error_empty"] = 'Source Domain is empty.';
9+
$wb["source_error_unique"] = 'Duplicate source Domain.';
10+
$wb["source_error_regex"] = 'Invalid source domain name.';
11+
?>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Domain alias';
3+
$wb["active_txt"] = 'Active';
4+
$wb["source_txt"] = 'Source';
5+
$wb["destination_txt"] = 'Destination';
6+
$wb["source_txt"] = 'Source';
7+
$wb["add_new_record_txt"] = 'Add new Domain alias';
8+
?>

0 commit comments

Comments
 (0)