无法使用我的 postfix smtp 从 gmail 发送邮件

无法使用我的 postfix smtp 从 gmail 发送邮件

我在远程 VPS 上的 ubuntu 20.04 上安装了 postfix/dovecot,仅允许 ssl/tls 事务。我可以从本地计算机上的 thunderbird 客户端使用它发送/接收邮件。我可以在 gmail 中接收其邮件(使用“添加电子邮件帐户”选项)。服务器地址(和 letsencrypt 证书名称)是 mail.acupuncture-nantes.fr 但我无法使用其 smtp 服务从 gmail 发送邮件。当我尝试这样做时,gmail 说“TLS 协商失败,证书与主机不匹配。,代码:0”。

因此我增加了 Postfix 日志的详细程度,得到了以下结果:

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

有人有线索吗 ?

答案1

您是否更改了 Gmail 中的设置?添加了该地址?

https://support.google.com/mail/answer/22370?hl=en-EN

步骤 1:添加你自己的地址

On your computer, open Gmail.
In the top right, click Settings Settings and then See all settings.
Click the Accounts and import or Accounts tab.
In the "Send mail as" section, click Add another email address.
Enter your name and the address you want to send from.
Click Next Step and then Send verification.
For school or work accounts, enter the SMTP server (for example, smtp.gmail.com or smtp.yourschool.edu) and the username and password on that account.
Click Add Account.

第 2 步:确认地址

Sign in to the account you added.
Open the confirmation message you got from Gmail.
Click the link.

步骤 3:更改“发件人”地址

In the message, click the "From" line.
(If you don't see this, click the space next to the recipient's email.)
Select the address to send from.

相关内容