On Mon, Jan 10, 2011 at 06:35:23PM -0200, Lauro Costa G. Borges wrote: >>> Mail arrives to b...@domain1.org (and b...@domain1.org has an alias to >>> bla...@domain2.org). >> >> What do you mean by "has an alias"? > > I'll try to explain with an example: > > > I have these 2 domains: > > region1.company.com > > company.com > > Suppose every email to sa...@region1.company.com should also go to > sa...@company.com, then sa...@region1.company.com sends a copy to > sa...@company.com.
This still does not explain what "has an alias" means. What actual *mechanisms* and *settings* are used to implement such an "alias"? The transport table is not an aliasing mechanism. Rewriting mechanisms are explained in: http://www.postfix.org/ADDRESS_REWRITING_README.html >>> I would like the result to the query to be the domain I searched, AND >>> the other domains, since, in the case I have an alias, domain2.org also >>> needs to be listed as a domain a relay for. >> >> You are confused. Transport lookups are single valued. The lookup result >> in relay_domains is entirely ignored, ony the existence of the lookup >> key in the table is signficant. > > Ok, but what happens is this: > > A new email arrives to sa...@region1.company.com, when it enters the > mail system, 2 messages are put in the queue, right? No, only one, a single message stores multiple recipient records. > One for > sa...@region1.company.com, and another to sa...@company.com. Only if you have used virtual(5) to rewrite the input address to a pair of output addresses. > But the > transport map lookup is executed only for "region1.company.com", so > the mail to "sa...@company.com" does not have a transport, I guess. No. Each recipient address in a message is subjected to a separate (1-to-1) transport lookup. >> This is completely wrong. First, you have to explain what you mean by >> an "alias", where you want the mail to be delivered, what actually >> happens (detailed unmangled logs) and show your configuration. >> >> http://www.postfix.org/DEBUG_README.html#mail > > ldap-transport.cf: > > version = 3 > server_host = ldap://ldap.company.com:389 > search_base=ou=mail,ou=services,dc=company,dc=com > scope = sub > result_attribute=associatedDomain > query_filter=(&(objectclass=domainRelatedObject)(associatedDomain=%s)) > result_format=%s relay:[150.170.6.15] This table definition is grossly wrong. The VALUE of an LDAP transport lookup MUST be JUST the "transport:nexthop" pair, associadted with the lookup table. If you don't have any LDAP attributes that store the transport:nexthop string, then you use a *fixed* result_format with no "%s" part. > Jan 10 17:40:49 mx postfix/qmgr[14897]: warning: connect to transport > private/company.com relay: No such file or directory Indeed, your transport table is incorrectly defined. -- Viktor.