-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmysql-virtual_forwardings.cf.master
More file actions
21 lines (21 loc) · 1.43 KB
/
mysql-virtual_forwardings.cf.master
File metadata and controls
21 lines (21 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
hosts = {mysql_server_ip}
query = SELECT u.email as target FROM mail_forwarding as s
INNER JOIN mail_user as u ON (u.email = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND u.disabledeliver = 'n' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
WHERE s.source = '%s' AND s.type IN ('alias', 'forward') and s.active = 'y' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
INNER JOIN mail_forwarding as f ON (f.source = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND f.active = 'y' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
WHERE s.source = '@%d' AND s.type IN ('catchall') and s.active = 'y' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
INNER JOIN mail_forwarding as t ON (t.source = s.destination AND t.type = 'catchall')
WHERE s.source = '@%d' AND s.type = 'aliasdomain' and s.active = 'y' AND t.active = 'y' AND s.server_id = {server_id}