If you need to configure your local server to send outbound email via a specific host (such as if your server does not have port 25 access to the internet or if you are using Amazon’s SES service to send your emails using the SMTP host integration method), you may wish to configure your postfix service to send all emails via a specified SMTP server. This is often referred to as a “Smart host” or “Relay host”. Doing so will eliminate the requirement to configure the use of an external mail server/service in your code files for each specific application and to the application will appear to be a local mailing service.
How to
In order to implement this, simply add the below to your /etc/postfix/main.cf file, then restart postfix.
relayhost = serverhostname
You can also add an optional port number to the end of the server hostname (“:225″) for example if you need to set it to be a port other than 25.
If you are using Amazon’s SES service, you will need to follow the process outlined in their developer documentation to additionally add your SMTP username and password credentials for use.