1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Handle wildcard aliases using podop

This commit is contained in:
kaiyou 2018-09-27 14:53:23 +02:00
parent 0d52364eac
commit 542793260b

View File

@ -341,8 +341,13 @@ class Alias(Base, Email):
return cls.query.filter(
sqlalchemy.and_(cls.domain_name == domain_name,
sqlalchemy.or_(
cls.localpart == localpart,
cls.wildcard.like(localpart)
sqlalchemy.and_(
cls.wildcard == False,
cls.localpart == localpart
), sqlalchemy.and_(
cls.wildcard == True,
sqlalchemy.bindparam("l", localpart).like(cls.localpart)
)
)
)
).first()