On Wed, Mar 11, 2015 at 11:55:31PM +0800, Zhang Huangbin wrote:
> On Wed, Mar 11, 2015 at 11:46 PM, Viktor Dukhovni
> <postfix-us...@dukhovni.org> wrote:
> >
> > Not at present.  You can only suppress lookups for bare keys which
> > can happen when the domain is $myorigin or matches $mydestination
> > by interpolating the lookup key into the query via '%u@%d' instead
> > of '%s'.  That will filter out keys with no @domain part.
> 
> Thanks Victor. :)
> 
> I'm afraid that '%u' doesn't work, it still has '+extension' in query.
> for example:

I did not say it would solve your problem.  It addresses a different
need.

> As you can see, '%u' doesn't drop extension '+abc' in my test.
> Anything wrong in my testing?

No, that's what %u is supposed to do.

You may well be able to do something with advanced SQL string
manipulation to short-circuit queries that contain "+".

        SELECT result
        FROM table
        WHERE key = '%u@%d' 
        AND key NOT LIKE '%%+%%'

An SQL server may well optimize that query away when the key contains
a "+" and not do any disk I/O.

-- 
        Viktor.

Reply via email to