OSEC

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

From: Magnus Bäck (magnusdsek.lth.se)
Date: Tue Mar 06 2007 - 13:55:14 CST


On Tuesday, March 06, 2007 at 17:47 CET,
     Maxim Cherniavsky <maximcomstar.ru> wrote:

> 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?

Either make the appropriate mappings in virtual_mailbox_maps,

   userexample.com path/to/mailbox
   userexample.net path/to/mailbox

or use virtual aliasing.

   userexample.com userexample.net

> 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.

Correct.

> 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.

Why not? I'd use the virtual table, though.

> Any other solutions?

Why not list each users' all addresses in LDAP, schema permitting it?

--
Magnus Bäck
magnusdsek.lth.se