You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-08-10 22:31:47 +02:00
Fix prority between mailboxes and aliases, related to #38
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
dbpath = /data/freeposte.db
|
||||
query =
|
||||
SELECT destination
|
||||
FROM alias
|
||||
WHERE
|
||||
(
|
||||
alias.wildcard = 0
|
||||
AND
|
||||
alias.email = '%s'
|
||||
) OR (
|
||||
alias.wildcard = 1
|
||||
AND
|
||||
'%s' LIKE alias.email
|
||||
)
|
||||
ORDER BY
|
||||
alias.wildcard ASC,
|
||||
length(alias.localpart) DESC
|
||||
LIMIT 1
|
||||
SELECT destination
|
||||
FROM
|
||||
(SELECT destination, email, wildcard, localpart FROM alias
|
||||
UNION
|
||||
SELECT email AS destination, email, 0 as wildcard, localpart FROM user)
|
||||
WHERE
|
||||
(
|
||||
wildcard = 0
|
||||
AND
|
||||
email = '%s'
|
||||
) OR (
|
||||
wildcard = 1
|
||||
AND
|
||||
'%s' LIKE email
|
||||
)
|
||||
ORDER BY
|
||||
wildcard ASC,
|
||||
length(localpart) DESC
|
||||
LIMIT 1
|
||||
|
Reference in New Issue
Block a user