>>  Probably the best lesson to learn from postfixadmin is: you can have

>>  more than one lookup table in postfix per main.cf directive.
>>  Postfixadmin uses 2 separate queries for "regular" aliases and 
>> domain
>>  aliases.
>> 
>>  from main.cf:
>>  virtual_alias_maps = /etc/postfix/mysql_virtual_alias_maps.cf
>>  /etc/postfix/virtual_alias_domain_maps.cf
>> 
>>  where each file contains a simple db query. Makes it much easier to
>>  write the correct query, on the expense of some more db load.
> 
> Thanks Tom for making it more clear.
> 
> However, if you split to two queries, you still need a complex query for the 
> mapped domain. In my example, still like:
> 
> query = select if ('%d' = 'example-2.com', IFNULL((select dest 
> from aliases where addr = '%u...@example.com'), (select addr from users 
> where addr = '%u...@example.com')), NULL)
> 
> I've found that in conjunction with a 2nd query (the original normal one), 
> everything seems to work as expected (including aliases with only local parts 
> like "postmaster")
> 
> But I'm still unsure if this kind of query is correct, if I'm on the 
> right track. Can anyone tell me if there's a better way to do it?
> 
> Where are all those examples that are supposedly posted on this list 
> previously?

Bump - surely there's someone out there who has done this and can tell me if 
the kind of query above is either misguided or approximately what is needed to 
achieve this feature.

ie, Do I really have to query the alias table AND the account table?  

People have said on this list that other examples have been posted, but I can't 
find them.  Can someone please help?

Reply via email to