Today I did tried to implement one catch-all email per domain.

Actually it seems to me that I hit some bug.... which is most probably
very unlikely ... but still I want to share this experience and maybe
someone will point out where my problem lies.

postconf -n
Important lines:
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf

/etc/postfix/mysql-virtual-alias-maps.cf
Important line:
query = SELECT destination FROM view_aliases WHERE '%s' like
concat('%%',email,'%%') and '%s' not in (select email from
view_users);

I know this query can be very inefficient for large table(view) but
leave it now aside.

 postmap -q nonexist...@mydomain.com
mysql:/etc/postfix/mysql-virtual-alias-maps.cf
Output: catch...@mydomain.com

postmap -q exist...@mydomain.com mysql:/etc/postfix/mysql-virtual-alias-maps.cf
No output

sending an email to nonexist...@mydomain.com

99914906BB7: to=<catch...@mydomain.com>, orig_to=<nonexist...@mydomain.com>

So far so good

sending an email to exist...@mydomain.com

99914906BB7: to=<catch...@mydomain.com>, orig_to=<exist...@mydomain.com>

Oh ... I hate it ... Why?! Postmap said - no result.

Is there any way to debug this?

Actually I have other ways to solve it (probably!?) but I want to know
what is wrong with this.

And yes - one more thing... Somehow I DID suspect that postfix
replaces my %s in the query just the first time. I don't know why I
have this feeling.

Is there any way to test/debug it?


Valentin



-- 
Valentin Gjorgjioski
Mobile: +386 40 1 26 26 7
Email: gjorgjio...@gmail.com
--
Human knowledge belongs to the world
--

Reply via email to