Skip to content

Commit b4e90c9

Browse files
committed
exim4 config improved
1 parent 5667a92 commit b4e90c9

File tree

4 files changed

+563
-532
lines changed

4 files changed

+563
-532
lines changed

config/exim4/exim4.conf.template

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MYSQL_SERVER=localhost
77
MYSQL_USER=root
88
MYSQL_PASSWORD=matze
99
MYSQL_DB=mailserver
10-
MYSQL_EMAILTABLE=mail_email
10+
MYSQL_EMAILTABLE=mail_box
1111
MYSQL_DOMAINTABLE=mail_domain
1212
MYSQL_WHITETABLE=mail_whitelist
1313
MYSQL_BLACKTABLE=mail_blacklist
@@ -42,8 +42,8 @@ hide mysql_servers = "MYSQL_SERVER/MYSQL_DB/MYSQL_USER/MYSQL_PASSWORD"
4242

4343
primary_hostname = MAILSERVER_HOSTNAME
4444

45-
domainlist local_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND (type = 'local' OR type = 'alias')
46-
domainlist relay_to_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND type = 'relay'
45+
domainlist local_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND type = 'local'
46+
domainlist relay_to_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND (type = 'relay' OR type = 'alias')
4747
hostlist relay_from_hosts = 127.0.0.1
4848
domainlist mmdomains = ${lookup mysql {SELECT domain FROM mail_mailman_domain}}
4949

@@ -151,6 +151,11 @@ fail_router:
151151
data = ":fail:"
152152
allow_fail
153153

154+
domain_aliases:
155+
driver=redirect
156+
domains=${lookup mysql{SELECT domain FROM mail_domain WHERE domain='${domain}' AND type = 'alias'}}
157+
data=$local_part@${lookup mysql{SELECT destination FROM mail_domain WHERE domain='${domain}'}}
158+
154159
mailman_router:
155160
driver = accept
156161
domains = +mmdomains
@@ -171,14 +176,9 @@ dnslookup:
171176
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
172177
no_more
173178

174-
domain_aliases:
175-
driver=redirect
176-
domains=${lookup mysql{SELECT domain FROM mail_domain WHERE type = 'alias'}}
177-
data=$local_part@${lookup mysql{SELECT destination FROM mail_domain WHERE domain='${domain}'}}
178-
179179
blacklist_router:
180180
driver = manualroute
181-
senders = ${lookup mysql {SELECT DISTINCT MYSQL_BLACKTABLE.address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE MYSQL_BLACKTABLE.address}{$value}}
181+
senders = ${lookup mysql {SELECT DISTINCT address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE address}{$value}}
182182
condition = "${if !def:h_X-Spam-Flag: {1}{0}}"
183183
headers_add = X-Spam-Flag: YES
184184
route_list = * localhost
@@ -222,13 +222,15 @@ mysql_email_forward:
222222
# transport = spamcheck
223223
# verify = false
224224

225-
#spampurge_router:
226-
# driver = manualroute
227-
# domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND spampurge='yes'}{$value}}
228-
# condition = "${if eq{$h_X-Spam-Flag:}{YES} {1}{0}}"
229-
# route_list = "* localhost byname"
230-
# transport = devnull_transport
231-
# verify = false
225+
spamdelete_router:
226+
driver = manualroute
227+
domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND spamdelete = '1'}{$value}}
228+
# condition = "${if eq{$h_X-Spam-Flag:}{YES} {1}{0}}"
229+
condition = "${if match{$h_X-Spam-Flag}{YES} {1}{0}}"
230+
route_list = "* localhost byname"
231+
transport = devnull_transport
232+
verify = false
233+
232234

233235
autoresponder_router:
234236
driver = accept
@@ -247,12 +249,12 @@ forward_router:
247249

248250
local_mailbox_router:
249251
driver = accept
250-
domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND maildir != ''}{$value}}
252+
domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND maildir != '' AND active = '1'}{$value}}
251253
transport = local_delivery
252254

253-
mysql_default_router:
255+
mysql_catchall_router:
254256
driver=redirect
255-
data=${lookup mysql{ SELECT dest FROM mail_virtual_default WHERE domain='${domain}'}}
257+
data=${lookup mysql{ SELECT destination FROM mail_domain_catchall WHERE domain='${domain}'}}
256258
allow_fail
257259
allow_defer
258260

@@ -404,14 +406,14 @@ begin authenticators
404406
fixed_plain:
405407
driver = plaintext
406408
public_name = PLAIN
407-
server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$2}' AND cryptpwd=encrypt('${quote_mysql:$3}' AND active = '1', cryptpwd)}{1}fail}
409+
server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$2}' AND cryptpwd=encrypt('${quote_mysql:$3}', cryptpwd) AND active = '1'}{1}fail}
408410
server_set_id = $2
409411

410412
fixed_login:
411413
driver = plaintext
412414
public_name = LOGIN
413415
server_prompts = "Username:: : Password::"
414-
server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$1}' AND cryptpwd=encrypt('${quote_mysql:$2}' AND active = '1', cryptpwd)}{1}fail}
416+
server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$1}' AND cryptpwd=encrypt('${quote_mysql:$2}', cryptpwd) AND active = '1'}{1}fail}
415417
server_set_id = $1
416418

417419
cram:

interface/lib/config.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
ini_set('register_globals',0);
3131

32-
$conf["rootpath"] = "D:\\www\\ispconfig3\\interface";
33-
//$conf["rootpath"] = "D:\\www\\ispconfig3\\interface";
34-
//$conf["rootpath"] = "/home/www/ispconfig3/web/cms";
32+
$conf["rootpath"] = "F:\\server\\www\\ispconfig3\\interface";
33+
//$conf["rootpath"] = "D:\\www\\ispconfig3\\interface";
34+
//$conf["rootpath"] = "/home/www/ispconfig3/web/cms";
3535

3636
$conf["fs_div"] = "\\"; // File system divider, \\ on windows and / on linux and unix
3737
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";

0 commit comments

Comments
 (0)