Daniel Funke wrote: > Hi, > > I have a postfix gateway sending mails to accounts on different > backend systems and to local maildirs for imap. But the destination of > an email should depend from the single recipient address not from the > complete destination domain. > > I'll try to explain it with my testdomain "example.com". My config is > below. > > In the transport you can see addresses which are redirected to an > exchange-server without changing the recipient address. In the virtual > I have addresses for local maildirs (funked03) and for backend systems > needing a rewrite of the recipient address ([EMAIL PROTECTED]). In > the last line the [EMAIL PROTECTED] at the right hand side is needed to > look for this address in the transport. > > If I haven't missed something all works as I want. Mails to unknown > recipients are rejected. > > But I found the information that it's never allowed to list a virtual > domain in mydestination. Do you have any idea how to do this better or > dou you think I could operate a system in this config without any > trouble? Only list domains this machine receives directly into mydestination (think final destination = this machine). For a domain that is forwarded on, use relay_domains AND relay_recipient_maps. Do not blindly accept addresses by omitting relay_recipient_maps. In the case of Exchange, Postfix can be setup to query LDAP. This can be to the AD directly or (recommended) to a local OpenLDAP mirror.
See http://www.postfix.org/ADDRESS_CLASS_README.html for details on Postfix's address classes. > > Best regards, > > Daniel > > ------------------------------------------------------------ > main.cf: > -------- > mynetworks = 127.0.0.0/8 > mydestination = $myhostname, localhost.$mydomain, localhost, example.com > transport_maps = hash:/etc/postfix/transport > virtual_alias_domains = > virtual_alias_maps = hash:/etc/postfix/virtual > local_recipient_maps = hash:/etc/postfix/transport Please do not reuse different maps like this. It may work now, but could easily break in the future. > > > transport: > ---------- > [EMAIL PROTECTED] smtp:[192.168.1.10] > [EMAIL PROTECTED] smtp:[192.168.1.10] This does not take the place of validation. Simplify this to 'example.com smtp:[192.168.1.10]' and create a real recipient map. > notes-in.local smtp:[192.168.1.120] > > > virtual: > -------- > [EMAIL PROTECTED] funked03 Note, this appends myorigin and then the delivery process continues. If myorigin is NOT in an address class, it will bounce. Furthermore, the mapping you suggest above will *break* local machine validation and cause bounces. > [EMAIL PROTECTED] [EMAIL PROTECTED] > [EMAIL PROTECTED] [EMAIL PROTECTED], funked03, [EMAIL PROTECTED] > ------------------------------------------------------------ >