CentOS Mail Client via Postfix Relay

There was a need for one of my VPSs to be able to send mail externally via my Postfix Mailserver which is running on another box. Simple enough:

Client:

# yum install sendmail
# vi /etc/sysconfig/sendmail 

  DAEMON=no

# vi /etc/mail/submit.cf

   D{MTAHost}mailserver.mydomain.com

Mail Server:

# vi /etc/postfix/main.cf

Add the following to mynetworks section instead of using host mode (example):

mynetworks = [local box ip]/32, [client box ip]/32, 127.0.0.0/8

Restart postfix.

# service postfix restart

Test from the client.

# mailx -s "Test email" myusername@gmail.com < /dev/null