clarification of relay_domains and virtual_alias_domains

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clarification of relay_domains and virtual_alias_domains

Juan Miscaro-2
Hi, I'm looking for clarification and validation of how I want to set
up a few servers.

I have a content filter (amavisd-new) gateway that will forward mail
for multiple domains.  The domains and their users are, respectively,
listed in relay_domains and relay_recipient_maps.  All mail is
forwarded (no local delivery) to a couple of different (IMAP) servers
depending on domain or address (as per a transport table).  These
servers will be controlled by me and will be configured to accept mail
for the domains in question.

I hope this is a coherent setup (with Postfix 2.6).

Secondly, I want to accept mail for certain domains (their MX entries
pointing to my server) and then rewrite recipients to remote
addresses.  The domain of the rewritten address is handled by another
server (different MX entry) that I am not responsible for.

For this second setup I figure I can use virtual_alias_domains.  Is
this correct?  I'm not sure if I should be using a transport table for
this.  My thinking is I can if I want but it will work without it
since an MX record exists for the destination domain (and save myself
a DNS lookup).

Thanks everyone.

/juan
Reply | Threaded
Open this post in threaded view
|

Re: clarification of relay_domains and virtual_alias_domains

mouss-2
Juan Miscaro wrote:

> Hi, I'm looking for clarification and validation of how I want to set
> up a few servers.
>
> I have a content filter (amavisd-new) gateway that will forward mail
> for multiple domains.  The domains and their users are, respectively,
> listed in relay_domains and relay_recipient_maps.  All mail is
> forwarded (no local delivery) to a couple of different (IMAP) servers
> depending on domain or address (as per a transport table).  These
> servers will be controlled by me and will be configured to accept mail
> for the domains in question.
>
> I hope this is a coherent setup (with Postfix 2.6).
>
> Secondly, I want to accept mail for certain domains (their MX entries
> pointing to my server) and then rewrite recipients to remote
> addresses.  The domain of the rewritten address is handled by another
> server (different MX entry) that I am not responsible for.
>
> For this second setup I figure I can use virtual_alias_domains.  Is
> this correct?  I'm not sure if I should be using a transport table for
> this.  My thinking is I can if I want but it will work without it
> since an MX record exists for the destination domain (and save myself
> a DNS lookup).
>  

if all addresses are rewritten to another domain, then you can use
relay_domains, virtual_alias_domains or virtual_mailbox_domains. it
doesn't really matter, although virtual_alias_domains is probably the
natural choice.

if after all rewrite, some addresses retain that domain, then you cannot
use virtual_alias_domains. if so, relay_domains is probably the natural
choice.

in either case, most of the work is setting up the rewrite mappings in
virtual_alias_maps (fo not confuse these with virtual_alias_domains.
virtual_alias_maps map addresses in any domain).

do not use wildcard virtual aliases such as
@example.com      @example.org
because they break recipient validation: postfix will accept all
addresses *@example.com, only to realize later that their *@example.org
equivalent does not exist. This causes a bounce and makes you a
backscatter source.


Reply | Threaded
Open this post in threaded view
|

Re: clarification of relay_domains and virtual_alias_domains

Wietse Venema
In reply to this post by Juan Miscaro-2
Juan Miscaro:
> Secondly, I want to accept mail for certain domains (their MX entries
> pointing to my server) and then rewrite recipients to remote
> addresses.  The domain of the rewritten address is handled by another
> server (different MX entry) that I am not responsible for.
>
> For this second setup I figure I can use virtual_alias_domains.  Is
> this correct?

Yes. Virtual alias domains replace all valid recipients in a domain
by addresses in a different (local or remote) domain.  All other
addresses (i.e. not valid, or not rewritten to a different domain)
resolve as "user unknown in virtual alias domain".

        Wietse