OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: virtual_alias_domains fighting with relay_domains

From: mouss (mlist.onlyfree.fr)
Date: Thu Jul 05 2007 - 06:00:47 CDT


Colin Campbell wrote:
> [snip]
> I guess I haven't been clear enough.
>
> In virtual_alias_domains if have my top level domain, in this case
> "citec.com.au". I need to do rewrites on addresses in that domain, hence
> it's in virtual_alias_domains.

I understood that, but the rewrite is done by virtual_alias_maps, not
virtual_domain_maps. so putting the domain in relay domains will not
change the situation.

> There are several sub domains of
> citec.com.au that require rewrites as well. They're, as required, in
> virtual_alias_domains. However I need to accept email for
> somehost.citec.com.au (many of), otherdomain.citec.com.au (many of) and
> somehost.subdomain.citec.com.au (many of). I can't put them all in
> virtual_alias_domains. To the best of my limited Postfix knowledge, they
> have to be in relay_domains. I can't take those in virtual_alais_domains
> out and put them into relay_domains cos I need to do the rewrites.
>
> What I'm expecting, perhaps naively, is that postfix would behave
> something like DNS does with wildcard MX records - if a specific entry
> exists (eg subdomain.citec.com.au) in a table, use that otherwise if a
> "wildcard" (eg .citec.com.au) exist in some other table, then use that,
> else fail.
>
> In transport and relay_domains (I believe p_d_m_s doesn't support
> virtual_alias_domains) I am using "." to avoid
> "parent_domain_matches_subdomain". As far as I know I'm not relying on
> that variable for anything "useful" although I'm more than happy to be
> corrected.
>
> So, if someone can tell me how to have:
>
> domain.tld, sub1.domain.tld, sub2.domain.tls, host.domain.tld
>
> in virtual_alias_domains, and at the same time accept, without warnings,
> email for
>
> sub3.domain.tld, host2.domain.tld, host1.sub4.domain.tld
>

you can list the domains one by one in whatever class they should be.
otherwise, put them all under relay_domains and let virtual_alias_maps
do the rewrite (which is anyway necessary. virtual_alias_domains will
only tell postfix to accept mail for that domain, it won't help for
delivery).