On 13.09.2010 19:29 Victor Duchovni wrote:
On Mon, Sep 13, 2010 at 07:23:41PM +0200, Valentin Gjorgjioski wrote:

Have tried this
SELECT destination FROM view_aliases WHERE '%s' like
concat('%%',email,'%%') and '%...@%d' not in (select email from view_users);
Postmap does a single lookup with the literal key you supply. Virtual
alias lookups on the other hand, use multiple lookup keys and are
recursive. You need to test all the lookup keys, and recursively test
any output values.


Yes - that was very good pointer - that actually I got after reading your previous emails very carefully.

This query seems to work:

query = SELECT destination FROM view_aliases WHERE '%s' LIKE concat('%%',email,'%%') AND ('%s' NOT IN (select email from view_users) AND '%s'<>'@%d')

The problem was when the key is only @mydomain.com

query = SELECT destination FROM view_aliases WHERE email='%s'

was working just fine so far.
It would be a good idea to stick to that.
Most probably I will leave it just that, and explain once more to "someone" that catch-all email address is a bad idea :)

Many thanks for your help

Valentin

Reply via email to