Nochmal mit Catchall-Problem. Das hatte ich vorher nicht auf dem Schirm, sorry.
Am 17. Februar 2013 15:20 schrieb morphium morphium@morphium.info:
2 Lösungen:
- Subselect:
SELECT greylist FROM mail_users WHERE email = (SELECT destination FROM mail_virtual WHERE email = %s)
SELECT IF ( SELECT COUNT(*) FROM mail_virtual WHERE email = '%s' > 0, SELECT greylist FROM mail_users WHERE email = (SELECT destination FROM mail_virtual WHERE email = '%s'), SELECT greylist FROM mail_users WHERE email = (SELECT destination FROM mail_virtual WHERE iscatchall = 1 AND email LIKE CONCAT('%@',SUBSTRING_INDEX('%s', '@', -1))) )
- Join:
SELECT u.greylist as greylist FROM mail_users u, mail_virtual v WHERE u.email = v.destination AND v.email = %s
das schreib ich um wenn das oben nicht geht ;-)
Viele Grüße!