quickly setup relay/smarthost with smtp auth in postfix mail server
When we decided to host our mail with some other provider, the question of configuring our web servers to use that provider to send mail arise. Having CentOS and postfix as mail service in our hosts, we followed these steps to tell local postfix to use other smtp service to send mails.
1. Suppose you have example.com domain, create one separate mail account to be used in your scripts residing on web server for sending mails. As an example, let’s assume we have mailer@example.com with password mailer123 and mail server address as mail.example.com. Here mail.example.com points to provider mail server which is managing our mail infrastructure. Create a password map file which will contain this information: