Centos 7 - Sendmail 谷歌中继问题

Centos 7 - Sendmail 谷歌中继问题

由于我的 ISP 的 smtp 服务器无法正常工作,我决定使用 google 的服务器,使用端口 587,因为它没有被阻止。所以我遵循了本教程:https://linuxconfig.org/configuring-gmail-as-sendmail-email-relay。现在当我尝试发送时,我得到了这个:

sudo /usr/sbin/sendmail -v -q

Running /var/spool/mqueue/u6TBoGKj027936 (sequence 1 of 3)
<[email protected]>... Connecting to gmail-smtp-msa.l.google.com. port 587 via relay...
220 smtp.gmail.com ESMTP n128sm2730927lfb.45 - gsmtp
>>> EHLO dynavio.com
250-smtp.gmail.com at your service, [87.92.41.2]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO dynavio.com
250-smtp.gmail.com at your service, [87.92.41.2]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
>>> QUIT
221 2.0.0 closing connection n128sm2730927lfb.45 - gsmtp
<[email protected]>... Deferred: Temporary AUTH failure

邮件仍然没有发送,为什么设置 sendmail 这么难?

编辑:

Ok, i made some changes and now am getting this:
[email protected]... Connecting to gmail-smtp-msa.l.google.com. port 587 via relay...
220 smtp.gmail.com ESMTP g69sm5267646lji.44 - gsmtp
>>> EHLO dynavio.com
250-smtp.gmail.com at your service, [87.92.41.2]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO dynavio.com
250-smtp.gmail.com at your service, [87.92.41.2]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> ZHluYXZpby5jb29wQGdtYWlsLmNvbQ==
334 UGFzc3dvcmQ6
>>> MTYwOWVlY2M=
534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbuy
534-5.7.14 o2OFUpUafLjLSp0oOwV56X1PMcDOdU_NSJ-tIxcNg4eG05FIMmDPNp0lw6yyn8rt-2JPop
534-5.7.14 wrj3m4AoX4_RYtua4gpoJpBLGbEhdv8cYND0LB7zZFpXFEsZkSAl6Admnz7ocBgzgFmcFJ
534-5.7.14 AWgkWUrUC_TdY1rGh3-E54jrVPt8hkcrW-Kg5cgW10gI8GNgYGfSJcf_p7iS3jeFftT4Ij
534-5.7.14 ETjjxhxKR9Vfoh8TBvSX1W0o40YdA> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14  Learn more at
534 5.7.14  https://support.google.com/mail/answer/78754 g69sm5267646lji.44 - gsmtp
>>> AUTH PLAIN cm9vdABkeW5hdmlvLmNvb3BAZ21haWwuY29tADE2MDllZWNj
534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbv8
534-5.7.14 nN0UFd92qcwx3IrSgUlbzsnnHjlfZHm50wV-weu4xEYV8zyIJ4aaVHerzMekBa1o8ApYHO
534-5.7.14 EzwE6hUwDlC1boJKwkoinzqeWSgMLZiY6ki6fMeizSL_OnMcoUJdlva7dg7JUWpnyGiYco
534-5.7.14 l82HioM6NWMIgIdUE8wB35JNnNMOhlmkb0wuG2pffQfPqY6oZW_jR5VWkXl2c5UeOBYK_x
534-5.7.14 rAQNHWWuunvC1fvMbyDL67jtIY0wM> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14  Learn more at
534 5.7.14  https://support.google.com/mail/answer/78754 g69sm5267646lji.44 - gsmtp
>>> MAIL From:<[email protected]> SIZE=67
530-5.5.1 Authentication Required. Learn more at
530 5.5.1  https://support.google.com/mail/answer/14257 g69sm5267646lji.44 - gsmtp
duser... Connecting to local...
duser... Sent
Closing connection to gmail-smtp-msa.l.google.com.
>>> QUIT
221 2.0.0 closing connection g69sm5267646lji.44 - gsmtp

编辑#2: 所以现在它可以工作了,但由于某种原因,来自标题的邮件不起作用。

答案1

关于你的问题:

为什么设置 sendmail 这么难?

历史。

sendmail 的作者写了一篇很好的文章开源应用程序的架构关于设计选择、sendmail 的演变、经验教训以及:

17.8.1. 我会做不同的事情
也许我在 sendmail 方面犯下的最大错误是没有及早认识到它的重要性。我曾多次有机会推动世界朝着正确的方向发展,但我没有抓住这些机会;事实上,在某些情况下,我造成了损害,例如,在适当的时候没有让 sendmail 对错误输入进行更严格的控制。同样,我很早就意识到需要改进配置文件语法,当时可能已经部署了几百个 sendmail 实例,但决定不做任何改变,因为我不想给已安装的用户群带来不必要的痛苦。回想起来,最好尽早改进,造成暂时的痛苦,以便产生更好的长期结果。

相关内容