Handle wildcard aliases using podop

master
kaiyou 6 years ago
parent 0d52364eac
commit 542793260b

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

Loading…
Cancel
Save