On Mon, Jan 10, 2011 at 06:35:23PM -0200, Lauro Costa G. Borges wrote:
>>> Mail arrives to [email protected] (and [email protected] has an alias to
>>> [email protected]).
>>
>> 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 [email protected] should also go to
> [email protected], then [email protected] sends a copy to
> [email protected].
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 [email protected], 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
> [email protected], and another to [email protected].
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 "[email protected]" 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.