Postfix: multiple relayhost for 2 internet lines

postfixsmtp

Following setup is going on:

Firewall with 2 internet lines.
Postfix is running as MTA.

I have 2 ip's on the lan, 192.168.2.254 & 192.168.2.252

I would like to create the following situation:

Use both lan ip's for email handling.

  • 1st lan is used for direct emailing. (relayhost="")
  • 2nd lan is used to drop mails @ relayhost of the isp

The problem is that master.cf doesn't allow overriding the relayhost setting.

I have tried to use sender dependant relay host, but master.cf doesn't allow the overriding like relayhost.

Anyone an idea how to fix my problem?

Best Answer

You have to run two seperate smtpd processes, one bound to 192.168.2.254 and one bound to 192.168.2.252. See Managing multiple Postfix instances on a single host for examples.