I have a postfix/dovecot setup on ubuntu 20.04, on a remote VPS, allowing only ssl/tls transactions. I can send/receive mails with it from a thunderbird client on my local machine. I can receive its mails within gmail (with the "add email account" option). The server address (and letsencrypt certificate name) is mail.acupuncture-nantes.fr But I can not send mails from gmail using its smtp service. When i try to do so, gmail says "TLS Negotiation failed, the certificate doesn't match the host., code: 0".
So i increased postfix log verbosity and this is what i got :
Mar 16 20:33:50 mail postfix/smtpd[105555]: connect from mail-lj1-f169.google.com[209.85.208.169]
Mar 16 20:33:50 mail postfix/smtpd[105555]: smtp_stream_setup: maxtime=300 enable_deadline=0
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? 127.0.0.0/8
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? 127.0.0.0/8
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? [::ffff:127.0.0.0]/104
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? [::ffff:127.0.0.0]/104
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? [::1]/128
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? [::1]/128
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: mail-lj1-f169.google.com: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: 209.85.208.169: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: auto_clnt_open: connected to private/anvil
Mar 16 20:33:50 mail postfix/smtpd[105555]: event_enable_read: fd 18
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr request = connect
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr ident = submission:209.85.208.169
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 18 flush 49
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 18 got 25
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 0
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: count
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: count
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 1
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: rate
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: rate
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 1
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: (list terminator)
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: (end)
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 220 mail.acupuncture-nantes.fr ESMTP Postfix (Ubuntu)
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_create: SASL service=smtp, realm=(null)
Mar 16 20:33:50 mail postfix/smtpd[105555]: name_mask: noanonymous
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: Connecting
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 19 flush 24
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 19 got 118
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: VERSION?1?2
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: MECH?PLAIN?plaintext
Mar 16 20:33:50 mail postfix/smtpd[105555]: name_mask: plaintext
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: MECH?LOGIN?plaintext
Mar 16 20:33:50 mail postfix/smtpd[105555]: name_mask: plaintext
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: SPID?105364
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: CUID?8
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: COOKIE?e375291b6a8e2ee000e11a731cbe1739
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_connect: auth reply: DONE
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_mech_filter: keep mechanism: PLAIN
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_mech_filter: keep mechanism: LOGIN
Mar 16 20:33:50 mail postfix/smtpd[105555]: watchdog_pat: 0x55d3427fdd90
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 17 flush 55
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 17 got 31
Mar 16 20:33:50 mail postfix/smtpd[105555]: < mail-lj1-f169.google.com[209.85.208.169]: EHLO mail-lj1-f169.google.com
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: mail-lj1-f169.google.com: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: 209.85.208.169: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-mail.acupuncture-nantes.fr
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-PIPELINING
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-SIZE 10240000
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-ETRN
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-STARTTLS
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-AUTH PLAIN LOGIN
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-ENHANCEDSTATUSCODES
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-8BITMIME
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-DSN
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250-SMTPUTF8
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 250 CHUNKING
Mar 16 20:33:50 mail postfix/smtpd[105555]: watchdog_pat: 0x55d3427fdd90
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 17 flush 189
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 17 got 10
Mar 16 20:33:50 mail postfix/smtpd[105555]: < mail-lj1-f169.google.com[209.85.208.169]: STARTTLS
Mar 16 20:33:50 mail postfix/smtpd[105555]: > mail-lj1-f169.google.com[209.85.208.169]: 220 2.0.0 Ready to start TLS
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 17 flush 30
Mar 16 20:33:50 mail postfix/smtpd[105555]: event_request_timer: reset 0x7f6cd8d58190 0x55d3427cbfe0 5
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr request = seed
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr size = 32
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 12 flush 22
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 12 got 60
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 0
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: seed
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: seed
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: aM27khi9flUA+8S56ap9hFbm0PUBbj3bCQLsU47NuQs=
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: (list terminator)
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: (end)
Mar 16 20:33:50 mail postfix/smtpd[105555]: event_request_timer: reset 0x7f6cd8d58190 0x55d3427cbfe0 5
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr request = tktkey
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr keyname = [data 0 bytes]
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 12 flush 25
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 12 got 138
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 0
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: keybuf
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: keybuf
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: CzEDKvTQCEVWLi7B9wqf53c3altwIi2yJi4g2hKrL5kpcj0374EtsoQSYGUivk46m2U38yt9hK5/kTXJmilnI50G8ZrUivySgoJ5rRukoVUlD1FgAAAAAA==
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: (list terminator)
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: (end)
Mar 16 20:33:50 mail postfix/smtpd[105555]: event_request_timer: reset 0x7f6cd8d58190 0x55d3427cbfe0 5
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr request = update
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr cache_type = smtpd
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr cache_id = 49AD9D0EAB1133FFBF2DB33476C35AEAAAA046077DA024D97EE2D7CA6D2D881A&s=submission&l=269488287
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr session = [data 119 bytes]
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 12 flush 301
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 12 got 10
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 0
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/tlsmgr: wanted attribute: (list terminator)
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: (end)
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_create: SASL service=smtp, realm=(null)
Mar 16 20:33:50 mail postfix/smtpd[105555]: name_mask: noanonymous
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_mech_filter: keep mechanism: PLAIN
Mar 16 20:33:50 mail postfix/smtpd[105555]: xsasl_dovecot_server_mech_filter: keep mechanism: LOGIN
Mar 16 20:33:50 mail postfix/smtpd[105555]: watchdog_pat: 0x55d3427fdd90
Mar 16 20:33:50 mail postfix/smtpd[105555]: smtp_get: EOF
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? 127.0.0.0/8
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? 127.0.0.0/8
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? [::ffff:127.0.0.0]/104
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? [::ffff:127.0.0.0]/104
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostname: smtpd_client_event_limit_exceptions: mail-lj1-f169.google.com ~? [::1]/128
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_hostaddr: smtpd_client_event_limit_exceptions: 209.85.208.169 ~? [::1]/128
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: mail-lj1-f169.google.com: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: match_list_match: 209.85.208.169: no match
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr request = disconnect
Mar 16 20:33:50 mail postfix/smtpd[105555]: send attr ident = submission:209.85.208.169
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_fflush_some: fd 18 flush 52
Mar 16 20:33:50 mail postfix/smtpd[105555]: vstream_buf_get_ready: fd 18 got 10
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: status
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute value: 0
Mar 16 20:33:50 mail postfix/smtpd[105555]: private/anvil: wanted attribute: (list terminator)
Mar 16 20:33:50 mail postfix/smtpd[105555]: input attribute name: (end)
Mar 16 20:33:50 mail postfix/smtpd[105555]: lost connection after STARTTLS from mail-lj1-f169.google.com[209.85.208.169]
Mar 16 20:33:50 mail postfix/smtpd[105555]: disconnect from mail-lj1-f169.google.com[209.85.208.169] ehlo=1 starttls=1 commands=2
does anyone have a clue ?