使用sendmail向Gmail发送邮件时触发550-5.7.26认证失败错误的求助
大家好,我最近碰到一个头疼的问题:用sendmail发邮件到Gmail时,总是被拒收,触发了550-5.7.26的认证失败错误,想请各位帮忙排查下原因。
先说说我的环境:我的域名没有和当前主机在同一个服务商注册,所以用了自定义域名服务器。当我通过以下命令发送测试邮件时:
sendmail mytest@gmail.com this is a test. .
立刻收到了Gmail的错误回复:
(reason: 550-5.7.26 This mail has been blocked because the sender is unauthenticated.)
----- Transcript of session follows -----
... while talking to gmail-smtp-in.l.google.com.:
DATA
<<< 550-5.7.26 This mail has been blocked because the sender is unauthenticated.
<<< 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM.
<<< 550-5.7.26
<<< 550-5.7.26 Authentication results:
<<< 550-5.7.26 DKIM = did not pass
<<< 550-5.7.26 SPF [194.135.94.254] with ip: [194.135.94.254] = did not pass
<<< 550-5.7.26
<<< 550-5.7.26 For instructions on setting up authentication, go to
<<< 550 5.7.26 https://support.google.com/mail/answer/81126#authentication u20-20020a05651206
...skipping 1 line
554 5.0.0 Service unavailable
我用在线邮件检查工具查过,工具显示我的SPF是配置正常的;之后又创建了默认选择器的DKIM记录,检查结果也显示没问题。不过用邮件健康检查工具时,发现了一个错误:smtp website.com Failed To Connect
另外,我把发送邮件到unreturner@gmail.com时的mail.log内容贴出来,里面有个关键报错:
Feb 10 03:50:23 1cr0 sendmail[347972]: 41A1oMOk347972: from=tmc, size=6, class=0, nrcpts=1, msgid=<202402100150.41A1oMOk347972@1cr0.l.hostens.cloud>, relay=tmc@localhost Feb 10 03:50:23 1cr0 sm-mta[347973]: 41A1oNCO347973: from=<tmc@1cr0.l.hostens.cloud>, size=295, class=0, nrcpts=1, msgid=<202402100150.41A1oMOk347972@1cr0.l.hostens.cloud>, proto=ESMTP, daemon=MTA-v4, relay=website.com [127.0.0.1] Feb 10 03:50:23 1cr0 opendkim[312964]: 41A1oNCO347973: no signing table match for 'tmc@1cr0.l.hostens.cloud' Feb 10 03:50:23 1cr0 opendkim[312964]: 41A1oNCO347973: no signature data Feb 10 03:50:23 1cr0 sendmail[347972]: 41A1oMOk347972: to=unreturner@gmail.com, ctladdr=tmc (1000/1000), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30006, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (41A1oNCO347973 Message accepted for delivery) Feb 10 03:50:23 1cr0 sm-mta[347975]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1.3, verify=FAIL, cipher=TLS_AES_256_GCM_SHA384, bits=256/256 Feb 10 03:50:24 1cr0 sm-mta[347975]: 41A1oNCO347973: to=<unreturner@gmail.com>, ctladdr=<tmc@1cr0.l.hostens.cloud> (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120295, relay=gmail-smtp-in.l.google.com. [64.233.164.27], dsn=5.0.0, stat=Service unavailable Feb 10 03:50:24 1cr0 sm-mta[347975]: 41A1oNCO347973: 41A1oOCO347975: DSN: Service unavailable Feb 10 03:50:24 1cr0 sm-mta[347975]: 41A1oOCO347975: to=<tmc@1cr0.l.hostens.cloud>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
我已经跟着教程一步步配置了opendkim和sendmail,但mail.log里还是显示no signing table match for 'tmc@1cr0.l.hostens.cloud',而且Gmail那边依然判定SPF和DKIM都没通过。实在搞不懂哪里出问题了,有没有大佬能帮忙分析下?
备注:内容来源于stack exchange,提问作者John Sall

