Postfix lives in 2 locations on OS X / OS X Server
OSX Server / Mail tip -
Postfix location: /Library/Server/Mail/Config/postfix/main.cf
Note: [smtp.gmail.com]:587 will break the UI I suspect due to the [].
Postfix sasl password:
/Library/Server/Mail/Config/postfix/sasl/passwd
Don't forget to postmap update:
sudo postmap /Library/Server/Mail/Config/postfix/sasl/passwd
There is also a /etc/postfix location which is confusing.
Had a similar problem. This helped me - main.cf
myhostname = smtp.gmail.com
# Use Gmail SMTP
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
tls_random_source = dev:/dev/urandom
smtp_sasl_tls_security_options = noanonymous
and
sasl_passwd
[smtp.gmail.com]:587 email@gmail.com:pass