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:


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


# vi /etc/mail/submit.cf


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,

Restart postfix.

# service postfix restart

Test from the client.

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