We use Postfix as a dropin replacement for Sendmail on our servers.  We wanted to configure postfix to relay email via our internal mail server for internal email addresses, and send directly if the email address was external.

To do this, follow these steps:

  1. Edit the /etc/postfix/transport file and add the following line:
  2. myinternaldomain.com   smtp:[ipaddress]:25
  3. Edit the /etc/postfix/main.cf file and add the following line to the end:
  4. transport_maps = hash:/etc/postfix/transport
  5. Run the following commands at the prompt:
  6. [root@triton postfix]# postfix /etc/postfix/transport
    
    [root@triton postfix]# service postfix restart
    

And you should be done!