I'm trying to set up postfix to use the gmail relay server. It's supposedly at smtp-relay.gmail.com:587. I had this working with another ISP but it doesn't work with google's email server. I should have been able to just up the relay host and log in credentials. It's more dificult.
This is the settings in postfix/main.cf:
When I attempt to send an email I get this error in mail.log:
This sounds like postfix config is missing something. The internet searches for using the gmail relay server shows basically what I have.
What am I missing?
Thanks
This is the settings in postfix/main.cf:
Code:
relayhost = [smtp-relay.gmail.com]:587smtp_use_tls=yessmtp_sasl_auth_enable = yessmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwdsmtp_sasl_security_options = noanonymoussmtp_sasl_tls_security_options = noanonymoussmtp_tls_wrappermode = yessmtp_tls_security_level = encryptNow if i try openssl:2025-04-20T19:09:36.626208-04:00 ph3 postfix/smtp[32462]: SSL_connect error to smtp-relay.gmail.com[173.194.219.28]:587: -1
2025-04-20T19:09:36.626654-04:00 ph3 postfix/smtp[32462]: warning: TLS library problem: error:0A00010B:SSL routines::wrong version number:../ssl/record/ssl3_record.c:354:
2025-04-20T19:09:36.671523-04:00 ph3 postfix/smtp[32462]: 8F9C5621592: to=<xxxxxxx@yyyyyyyy.com>, relay=smtp-relay.gmail.com[173.194.219.28]:587, delay=576, delays=576/0.11/0.17/0, dsn=4.7.5, status=deferred (Cannot start TLS: handshake failure)
I get the same library error but I don't connect. If I add -starttls smtp I get this (abbreviated)openssl s_client -connect smtp-relay.gmail.com:587 CONNECTED(00000003)
20B0ABF7:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:354:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 326 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
and it's wating for additional input. So I can connect to the gmail relay server with openssl but postfix has a problem.openssl s_client -starttls smtp -connect smtp-relay.gmail.com:587
CONNECTED(00000003)
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R4
verify return:1
depth=1 C = US, O = Google Trust Services, CN = WE2
verify return:1
depth=0 CN = smtp-relay.gmail.com
verify return:1
...
This sounds like postfix config is missing something. The internet searches for using the gmail relay server shows basically what I have.
What am I missing?
Thanks
Statistics: Posted by billrv — Sun Apr 20, 2025 11:30 pm