Skip to content

Commit e22f1ee

Browse files
committed
Updates mail module
1 parent bbb036a commit e22f1ee

File tree

123 files changed

+4582
-3419
lines changed

Some content is hidden

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

123 files changed

+4582
-3419
lines changed

config/exim4/exim4.conf.template

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ acl_check_rcpt:
126126
domains = +local_domains
127127

128128
require verify = sender
129+
130+
# Whitelist
131+
129132

130-
# Blacklist management
133+
# Blacklist
131134
deny senders = ${lookup mysql {SELECT DISTINCT address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE address \
132135
AND (recipient = '' OR recipient = '${quote_mysql:$domain}' OR recipient = '${quote_mysql:$local_part}@${quote_mysql:$domain}') \
133136
AND active = '1' AND server_id = 'MAILSERVER_ID'}{$value}}
@@ -159,11 +162,11 @@ acl_check_host:
159162

160163
acl_check_helo:
161164
accept hosts = +relay_from_hosts
162-
# If the HELO pretend to be this host
163-
deny condition = ${if or { \
164-
{eq {${lc:$sender_helo_name}}{MAILSERVER_HOSTNAME}} \
165-
{eq {${lc:$sender_helo_name}}{MAILSERVER_IP}} \
166-
} {true}{false} }
165+
# If the HELO pretend to be this host
166+
deny condition = ${if or { \
167+
{eq {${lc:$sender_helo_name}}{MAILSERVER_HOSTNAME}} \
168+
{eq {${lc:$sender_helo_name}}{MAILSERVER_IP}} \
169+
} {true}{false} }
167170
# by default we accept
168171
accept
169172

@@ -182,9 +185,9 @@ acl_check_data:
182185

183186
warn message = X-SA-Report: $spam_report
184187
spam = nobody:true
185-
186188
condition = ${if >{$spam_score_int}{0}{true}{false}}
187-
warn message = X-SA-Status: Yes
189+
190+
warn message = X-SA-Status: Yes
188191
spam = nobody:true
189192
condition = ${if >{$spam_score_int}{50}{true}{false}}
190193

@@ -261,7 +264,7 @@ dnslookup:
261264
# allow_fail
262265
# allow_defer
263266
# data = ${lookup{$local_part}lsearch{/etc/aliases}}
264-
# user = exim
267+
# user = exim
265268
# file_transport = address_file
266269
# pipe_transport = address_pipe
267270

@@ -347,14 +350,14 @@ autoresponder_router:
347350
transport = autoresponder_transport
348351
unseen
349352

350-
cc_router:
351-
driver = redirect
352-
data = ${lookup mysql {SELECT cc FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}}
353-
unseen
353+
# cc_router:
354+
# driver = redirect
355+
# data = ${lookup mysql {SELECT cc FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}}
356+
# unseen
354357

355-
forward_router:
356-
driver = redirect
357-
data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND forward != ''}{$value}}
358+
# forward_router:
359+
# driver = redirect
360+
# data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND forward != ''}{$value}}
358361

359362
local_mailbox_router:
360363
driver = accept
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2006, 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+
class getconf {
32+
33+
var $config;
34+
35+
function get_server_config($server_id, $section = '') {
36+
global $app;
37+
38+
if(!is_array($this->config[$server_id])) {
39+
$app->uses('ini_parser');
40+
$server_id = intval($server_id);
41+
$server = $app->db->queryOneRecord("SELECT config FROM server WHERE server_id = $server_id");
42+
$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server["config"]));
43+
}
44+
45+
if($section == '') {
46+
return $this->config[$server_id];
47+
} else {
48+
return $this->config[$server_id][$section];
49+
}
50+
}
51+
52+
function get_global_config() {
53+
54+
die("not yet implemented");
55+
56+
}
57+
58+
}
59+
60+
?>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2006, 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+
class ini_parser {
32+
33+
var $config;
34+
35+
function parse_ini_string($ini) {
36+
$ini = str_replace("\r\n","\n",$ini);
37+
$lines = explode("\n",$ini);
38+
39+
foreach($lines as $line) {
40+
41+
if($line != '') {
42+
$line = trim($line);
43+
if(preg_match("/^\[([\w\d_]+)\]$/", $line, $matches)) {
44+
$section = strtolower($matches[1]);
45+
} elseif(preg_match("/^([\w\d_]+)=(.*)$/", $line, $matches) && $section != null) {
46+
$item = trim($matches[1]);
47+
$this->config[$section][$item] = trim($matches[2]);
48+
}
49+
}
50+
}
51+
return $this->config;
52+
}
53+
54+
55+
56+
function get_ini_string($file) {
57+
$content = '';
58+
foreach($this->config as $section => $data) {
59+
$content .= "[$section]\n";
60+
foreach($data as $item => $value) {
61+
if($value != '') $content .= "$item=$value\n";
62+
}
63+
}
64+
return $content;
65+
}
66+
67+
}
68+
69+
?>

0 commit comments

Comments
 (0)