OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Postfix frontend on existing MySQL DB (routing problems)

From: Simone Felici (s.felicialpikom.it)
Date: Mon Jul 02 2007 - 02:17:41 CDT


mouss ha scritto:
> mouss wrote:
>>
>> Before you get mad, here is how a way to solev your problem:
>>
>> query = SELECT CONCAT('smtp:', next) FROM smtproutes where
>> domain = '%d' and %u = IF(account = '', %u, account)
>
> silly me, this is the same as OR. don't use it.
>
> use this:
>>
>>
>> query = SELECT CONCAT('smtp:', next) FROM smtproutes where
>> domain = '%d' and
>> (acount = '%u' or account = '')
>> order by length(account) desc limit 1
>
> an approach that doesn't require "advanced" sql statements is:
>
> transport_maps =
> proxy:mysql:/path/to/transport_users.cf
> proxy:mysql:/path/to/transport_domains.cf
>
> in transport_users, use the query with '%u' = account
> in transport_domains, use the same query but with '%u' = ''
>
>
>

Good morning mouss!

This is really a good morning for me, because, this solution WORKS!!!!

Thank's a loooot!!!!

Have a nice day!

Simon

--
Simone Felici E-Mail: s.felicialpikom.it
Divisione Tecnica Tel: 0461 030 111
Alpikom S.p.A. Fax: 0461 030 112
v.Fersina, 23 - 38100 Trento URL: http://www.alpikom.it