Smtp relay through gmail

How to relay all outgoing mail through gmail

i dont get it

like postfix

relayhost
relayhost = [{{.RelayHost}}]:{{.RelayHostPort}}
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain, login
smtp_use_tls = yes
smtp_tls_security_level = encrypt

I did provide a high level answer to this already in a different place. The easy answer is to use routing_domain to smart host your mail.

If you mean something else, please follow the instructions above and provide more detail and documentation.

Hi Tom, Can you add multiple smart host IP’s? and maybe do a load balance between them like a round-robin?

There is not one command to add an array of smart hosts, but you could certainly do that in code.

Since the routing domain is looked up as an MX, the MX records of Gmail will be followed, so you don’t need to define the Gmail IPs, just the domain.