Add support for sending from alternative domains

See Mailu/Mailu#415
master
Caleb Johnson 7 years ago committed by GitHub
parent bac906ba5b
commit b58dcfb511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,16 +2,16 @@ dbpath = /data/main.db
query = query =
SELECT destination SELECT destination
FROM FROM
(SELECT destination, email, wildcard, localpart FROM alias (SELECT destination, email, wildcard, localpart, localpart||'@'||alternative.name AS alt_email FROM alias LEFT JOIN alternative ON alias.domain_name = alternative.domain_name
UNION UNION
SELECT (CASE WHEN forward_enabled=1 THEN (CASE WHEN forward_keep=1 THEN email||',' ELSE '' END)||forward_destination ELSE email END) AS destination, email, 0 as wildcard, localpart FROM user SELECT (CASE WHEN forward_enabled=1 THEN (CASE WHEN forward_keep=1 THEN email||',' ELSE '' END)||forward_destination ELSE email END) AS destination, email, 0 as wildcard, localpart, localpart||'@'||alternative.name as alt_email FROM user LEFT JOIN alternative ON user.domain_name = alternative.domain_name
UNION UNION
SELECT '@'||domain_name as destination, '@'||name as email, 0 as wildcard, '' as localpart FROM alternative) SELECT '@'||domain_name as destination, '@'||name as email, 0 as wildcard, '' as localpart, NULL AS alt_email FROM alternative)
WHERE WHERE
( (
wildcard = 0 wildcard = 0
AND AND
email = '%s' (email = '%s' OR alt_email = '%s')
) OR ( ) OR (
wildcard = 1 wildcard = 1
AND AND

Loading…
Cancel
Save