Fix prority between mailboxes and aliases, related to #38
parent
ede346fd84
commit
1e9a8607b0
@ -1,18 +1,21 @@
|
|||||||
dbpath = /data/freeposte.db
|
dbpath = /data/freeposte.db
|
||||||
query =
|
query =
|
||||||
SELECT destination
|
SELECT destination
|
||||||
FROM alias
|
FROM
|
||||||
WHERE
|
(SELECT destination, email, wildcard, localpart FROM alias
|
||||||
(
|
UNION
|
||||||
alias.wildcard = 0
|
SELECT email AS destination, email, 0 as wildcard, localpart FROM user)
|
||||||
AND
|
WHERE
|
||||||
alias.email = '%s'
|
(
|
||||||
) OR (
|
wildcard = 0
|
||||||
alias.wildcard = 1
|
AND
|
||||||
AND
|
email = '%s'
|
||||||
'%s' LIKE alias.email
|
) OR (
|
||||||
)
|
wildcard = 1
|
||||||
ORDER BY
|
AND
|
||||||
alias.wildcard ASC,
|
'%s' LIKE email
|
||||||
length(alias.localpart) DESC
|
)
|
||||||
LIMIT 1
|
ORDER BY
|
||||||
|
wildcard ASC,
|
||||||
|
length(localpart) DESC
|
||||||
|
LIMIT 1
|
||||||
|
Loading…
Reference in New Issue