-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmysql-virtual_outgoing_bcc.cf.master
More file actions
19 lines (19 loc) · 1.36 KB
/
mysql-virtual_outgoing_bcc.cf.master
File metadata and controls
19 lines (19 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
hosts = {mysql_server_ip}
query = SELECT sender_cc FROM (
SELECT SUBSTRING_INDEX(sender_cc, ',', 1) AS sender_cc
FROM mail_user
WHERE email = '%s' AND disablesmtp = 'n' AND sender_cc != '' AND server_id = {server_id}
AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = {server_id})
UNION
SELECT SUBSTRING_INDEX(u.sender_cc, ',', 1) AS sender_cc
FROM mail_user u, mail_forwarding f
WHERE f.destination REGEXP CONCAT( '((^|\\n)[[:blank:]]*,?|[[:alnum:]][[:blank:]]*,)[[:blank:]]*',
REPLACE( REPLACE(u.email, '+', '\\+'), '.', '\\.' ),
'[[:blank:]]*(,[[:blank:]]*[[:alnum:]]|,?[[:blank:]]*(\\r?\\n|$))' )
AND u.disablesmtp = 'n' AND u.sender_cc != '' AND u.server_id = {server_id}
AND f.source = '%s' AND f.allow_send_as = 'y' AND f.active = 'y' AND f.server_id = {server_id}
AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = {server_id})
) table1 WHERE sender_cc != '' LIMIT 1