Have you ever been in a situation where you want to relay your emails from your Postfix server via another SMTP server? This is certainly possible and its way too simple:
First thing to do is configure Postfix in your machine. Once done, edit the configuration file for Postfix (usually under /etc/main.cf) and editing the below value:
#relayhost =to
relayhost = smtp.emailprovider.comOnce done, all emails sent via your Postfix server will be relayed through the desired Outgoing server.
Other options that may interest you are as follows:
- myhostname = hostname.emailprovider.com
- mydomain = emailprovider.com
- masquerade_domains = emailprovider.com
The last option will correct the envelopes shows as "user@emailprovider.com".
Hope that helps someone :-)