You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: install/tpl/mysql-virtual_forwardings.cf.master
+6-18Lines changed: 6 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,10 @@ user = {mysql_server_ispconfig_user}
2
2
password = {mysql_server_ispconfig_password}
3
3
dbname = {mysql_server_database}
4
4
hosts = {mysql_server_ip}
5
-
query = SELECT u.email as target FROM mail_forwarding as s
6
-
INNER JOIN mail_user as u ON (u.email = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
7
-
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND u.disabledeliver = 'n' AND s.server_id = {server_id}
5
+
query = SELECT s.destination AS target FROM mail_forwarding AS s
6
+
WHERE s.source = '%s' AND s.type IN ('alias', 'forward') AND s.active = 'y' AND s.server_id = {server_id}
8
7
UNION
9
-
SELECT s.destination as target FROM mail_forwarding as s
10
-
WHERE s.source = '%s' AND s.type IN ('alias', 'forward') and s.active = 'y' AND s.server_id = {server_id}
11
-
UNION
12
-
SELECT s.destination as target FROM mail_forwarding as s
13
-
INNER JOIN mail_forwarding as f ON (f.source = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
14
-
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND f.active = 'y' AND s.server_id = {server_id}
15
-
UNION
16
-
SELECT s.destination as target FROM mail_forwarding as s
17
-
LEFT JOIN mail_user as uu ON (uu.email = '%s' AND uu.disabledeliver = 'n')
18
-
LEFT JOIN mail_forwarding as uf ON (uf.source = '%s' AND uf.type IN ('alias', 'forward') AND uf.active = 'y')
19
-
WHERE s.source = '@%d' AND s.type IN ('catchall') and s.active = 'y' AND uu.mailuser_id IS NULL AND uf.forwarding_id IS NULL AND s.server_id = {server_id}
20
-
UNION
21
-
SELECT s.destination as target FROM mail_forwarding as s
22
-
INNER JOIN mail_forwarding as t ON (t.source = s.destination AND t.type = 'catchall')
23
-
WHERE s.source = '@%d' AND s.type = 'aliasdomain' and s.active = 'y' AND t.active = 'y' AND s.server_id = {server_id}
8
+
SELECT s.destination AS target FROM mail_forwarding AS s
9
+
WHERE s.source = '@%d' AND s.type = 'catchall' AND s.active = 'y' AND s.server_id = {server_id}
10
+
AND NOT EXISTS (SELECT email FROM mail_user WHERE email = '%s' AND server_id = {server_id})
11
+
AND NOT EXISTS (SELECT source FROM mail_forwarding WHERE source = '%s' AND active = 'y' AND server_id = {server_id})
0 commit comments