martin f krafft a écrit :
> also sprach Wietse Venema <wie...@porcupine.org> [2009.05.22.2010 +0200]:
>>>> Is it possiblew to instruct postfix to always deliver to a different
>>>> port when it tries to connect to a specific machine?
>>> iptables is not an option, since it cannot (yet) translate
>>> destination sockets for IPv6. Sorry, should have mentioned.
>> Use a transport map:
>>
>> example.com  [foo.example.com]:37331
> 
> I'd need an entry for every one of my couple of hundred domains
> since the transport maps are matched on recipient address, not on
> the MX domain.
> 
> Since I am using permit_mx_backup_networks, I'd rather avoid
> maintaining the list of domains in the transport map on the backup
> MX. Thus my asking.
> 

The following may work for mail received via smtp (but even if it works,
there is a problem with multi-recipient mail...).

- use check_recipient_mx_acess to return a FILTER statement to redirect
mail to a dedicated smtpd
- this smtpd has its ownl cleanup, to rewrite all domains to a single
one (which has the same MX):
  u...@domain => u...@domain@oneofthedomains
- a transport entry for "oneofthedomains" selects the host and port
- generic rewrite the address back (removes the trailing @oneofthedomains)

you can force all mail to go through smtp by setting a content_filter in
pickup.

now, there is still the problem for mail addresses to multiple
recipients, one of which in one of these domains, and another not in
these domains. you could fix this by adding an smtpd chain that forces
one recipient per transaction.

now, this is overly convoluted...

alternatives:
- disable IPv6 and use iptables NAT
- add a NAT box that supports IPv6 (*BSD with pf)
- use a log parser to build a transport table.
- write a content filter that does MX lookup, and if the destination is
the host you know, pass mail to a second instance
...


Reply via email to