On Thu, Feb 13, 2014 at 04:32:23PM +0000, [email protected] wrote:

> I would like to try and achieve the following behaviour:
> 
> Case A
> =====
> Message sent to [email protected]
> hosta.xxx.yyy.zzz contains an MX=0 record in our DNS
> Result: message to be routed to this user on this host
>
> Case B
> =====
> Message sent to [email protected]
> hostb.xxx.yyy.zzz has no MX record
> Result: message to be delivered locally to user2 (and an alias
> is then used to deliver the mail to the user's mailbox)

The only component of Postfix that performs MX lookups for mail
routing is the smtp(8) delivery agent, and clearly by that point
local delivery is no longer an option (one might imagine multi-hop
scenarios where some SMTP destinations end up performing local
delivery, but this is complex).

Your best bet is to in fact configure a transport table enumerating
all the machines for which delivery is either local or remote.

If automating the construction of such a table is not an option,
you can use socketmap or similar to implement an IPC lookup service
that queries DNS.  Either way, your transport should return either:

    local:<$myhostname>

or

    smtp:<nexthop>

-- 
        Viktor.

Reply via email to