How can I configure two Postfixes so one forwards emails to another for routing

I can easily configure Postfix host A to forward all emails to other Postfix host B like that:

relayhost = b.domain.com:25

But how can I tell host B to accept ALL traffic from A for full email processing/routing. There are no mailboxes on B. It's just a smarthost for routing.


Solution 1:

The Postfix documentation states:

By default, the Postfix SMTP server accepts:

  • Mail from clients whose IP address matches $mynetworks, or:
  • Mail to remote destinations that match $relay_domains, except for addresses that contain sender-specified routing (user@elsewhere@domain), or:
  • Mail to local destinations that match $inet_interfaces or $proxy_interfaces, $mydestination, $virtual_alias_domains, or $virtual_mailbox_domains.

As you cannot possible list each and every domain in $relay_domains I suggest you make sure the IP address that server A uses to forward email to server B is listed in B's $mynetworks. That way server B should accept and forward all emails from server A.