i have solved this problem with some subqueries and
the limit 1 is needed for MySQL < 5.5 because 5.1
meant that somewhere are more than one row returned
from a subquery

recipient_canonical_maps = mysql:/etc/postfix/mysql-rewritedomains.cf

[root@mail:/etc/postfix]$ cat /etc/postfix/mysql-rewritedomains.cf
user     = dbmailro
password = **********
dbname   = dbmail
hosts    = unix:/var/lib/mysql/mysql.sock
query    = select target from dbma_rewrite_domains where source like '%d'
           and ((select count(*) from dbmail_aliases where alias like
           (select concat('%u', (select target from dbma_rewrite_domains where 
source like
           '%d' limit 1)) from dbma_rewrite_domains limit 1))>0 or (select 
count(*) from
           dbmail_aliases where alias like '%u@' limit 1)>0) limit 1
___________________________

CREATE TABLE `dbma_rewrite_domains` (
  `source` varchar(255) NOT NULL,
  `target` varchar(255) NOT NULL,
  PRIMARY KEY (`source`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=1 DELAY_KEY_WRITE=1

source = alias-domain
target = @target-domain
___________________________

if postfix would not accept "postmaster" and "mailer-daemon" for
each domain even if it does not exist anywhere i would be
lucky because it does not make sense, but that is another problem

ok, postmaster is required and a global forwarder for all domains to me
but "mailer-daemon" does not exist anywhere :-(


Am 08.02.2011 22:37, schrieb Reindl Harald:
> 
> Am 08.02.2011 22:32, schrieb Charles Marcus:
> 
>>> Don't use "domain aliases".
>>>
>>> Wildcard address rewrites disable recipient validation.
>>
>> Postfixadmin (2.3.2+) has working recipient verification with alias
>> domains...
> 
> Hm - I will take a look what they do if i find no simple solution
> 
> external admin-software is a no-go because we have centralized and
> self-developed backends for postfix/dbmail, pureftpd, httpd, bind,
> dhcpd, domain-registration which is all tuned to work with each other
> in one admin-ui....

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to