OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
How to implement alias for whole virtual domain with smtp restrictions

From: Maxim Cherniavsky (maximcomstar.ru)
Date: Tue Mar 06 2007 - 10:47:02 CST


Hi all!
In my configuration I have virtual domain with defined user list in ldap
database
virtual_mailbox_domains = domain1.com
virtual_mailbox_maps = ldap:/etc/postfix/ldap/virtual_mailbox.cf (which
returns appropriate mailbox location for existing users in domain1.com)

I need to create full domain alias
userdomain2.com => userdomain1.com
And at the same time I'd like to keep smtp restrictions about existance of
users in domain1.com

How to implement it correctly?
As I know wildcard lookups are about missing such restrictions, so if I put

virtual_alias_maps = pcre:/etc/postfix/virtual_map_pcre
with
/^(.*)domain2.com/ $1domain1.com
Postfix doesn’t check that $1domain1.com exists in virtual_mailbox_maps.

In cause of stupid ldap search query language, I can't create second
virtual_mailbox_maps lookup table with this logic
If %d == domain2.com then
 lookup $udomain1.com

Creation of pereodicaly recreated map for virtual_mailbox_maps with full
mapping of users isnt good solution either.

Any other solutions?

Thanx in advance.

--
Best regards,
                            Maxim Cherniavsky
                            mailto: maxim (at) comstar.ru