What are the steps to set up postfix as SMTP relay that uses the Google Apps SMTP relay. There are a bunch of tutorials on the web that explain how to use the smtp.gmail.com
gateway with SASL authentication but I could not find a working configuration for the Google Apps relay smtp-relay.google.com
as described here, especially one that is specific to Google Compute.
I have setup the smtp relay service with 'Only addresses in my domains' as described here and verified that the IP is in fact the one I connect from.
I know that Google compute does not allow Port 25 as outgoing port as described here.
I am using debian linux or a debian derivative.
I have setup postfix as detailed in the docs but all i get in the mail.log is:
postfix/smtp[720]: send attr reason = host smtp-relay.gmail.com[66.102.1.28] said:
550-5.7.1 Invalid credentials for relay [104.155.78.1]. The IP address you've
550-5.7.1 registered in Google Apps SMTP Relay service doesn't match domain of
550-5.7.1 the accountthis email is being sent from. If you are trying to relay
550-5.7.1 mail from a domain that isn't registered under your Googles Apps
550-5.7.1 account or has empty envelope-from, you must configure your mail
550-5.7.1 server either to use SMTP AUTH to identify the sending domain or to
550-5.7.1 present one of your domain names in the HELO or EHLO command. For
550-5.7.1 more information, please visit
550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred kg2sm505213wjb.4 - gsmtp (in reply to MAIL FROM command)