You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
664 B
CFEngine3
24 lines
664 B
CFEngine3
8 years ago
|
dbpath = /data/main.db
|
||
9 years ago
|
query =
|
||
8 years ago
|
SELECT destination
|
||
|
FROM
|
||
|
(SELECT destination, email, wildcard, localpart FROM alias
|
||
|
UNION
|
||
7 years ago
|
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
|
||
|
UNION
|
||
|
SELECT '@'||domain_name as destination, '@'||name as email, 0 as wildcard, '' as localpart FROM alternative)
|
||
8 years ago
|
WHERE
|
||
|
(
|
||
|
wildcard = 0
|
||
|
AND
|
||
|
email = '%s'
|
||
|
) OR (
|
||
|
wildcard = 1
|
||
|
AND
|
||
|
'%s' LIKE email
|
||
|
)
|
||
|
ORDER BY
|
||
|
wildcard ASC,
|
||
|
length(localpart) DESC
|
||
|
LIMIT 1
|