如何修复“501 语法无效的 HELO 参数”?
我在发送主机和中继主机上都使用 exim,发送主机似乎提供:
HELO foo_bar.example.com
响应:
501 Syntactically invalid HELO argument(s)
I'm using exim on both the sending and relay hosts, the sending host seems to offer:
HELO foo_bar.example.com
Response:
501 Syntactically invalid HELO argument(s)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在花了这么多时间试图解决这个问题之后,在我的例子中,这个问题是从无到有的,我最终找到了一个解决方案。 就我而言,只有部署到 Suse 操作系统的系统突然停止发送电子邮件,但在 Ubuntu 上运行的系统(相同)却没有。 在用尽并消除所有建议的 这个问题的可能性,甚至考虑更改这些机器的操作系统,我发现发送电子邮件服务以某种方式对主机的主机名敏感。 在 Ubuntu 计算机中,文件 /etc/hosts 只有以下行:
127.0.0.1 localhost
,Suse 计算机也是如此,它停止发送电子邮件。 将 Suse 计算机中的 /etc/hosts 编辑为
127.0.0.1 localhost proplad
(其中 proplad 是计算机的主机名)后,错误消失了。 似乎某些安全策略(可能来自 smtp 服务)使用通过 API 携带的主机名信息,在 Ubuntu 机器上会被忽略,但在 Suse 机器上则不会。 希望这可以帮助其他人,避免在互联网上进行大量的研究。
After spending so many hours trying to fix this problem, which in my case just come up from nothing, I ended up with a solution. In my case, only the systems deployed to Suse OSs suddenly stopped sending emails but not those ( the same ) running on Ubuntu. After exhausting and eliminating all the suggested possibilities of this problem and even considering to change de OS of those machines, I found out that somehow the send email service is sensible to the hostname of the host machine. In the Ubuntu machines the file /etc/hosts have only the following line:
127.0.0.1 localhost
and so were the Suse machines, which stopped sending the emails. After editing the /etc/hosts from Suse machines to
127.0.0.1 localhost proplad
where proplad is the hostname of the machine, the errors were vanished. It seems that some security policy ( maybe from the smtp service ) uses the hostname information carried through the API, which was being ignored in the case of the Ubuntu machines, but not in the case of Suse machines. Hope this helps others, avoiding massive hours of research over the internet.
迪亚戈的回答帮助我解决了我一直想弄清楚的问题。
我们的 Suse 操作系统也突然停止工作。 尝试了我在这里和谷歌上找到的每一个建议。 什么都没起作用。 尝试将我们的域添加到 etc/hosts 但这没有帮助。
使用hostname命令获取服务器的主机名。 就像 Digao 建议的那样,将该主机名添加到 etc/hosts 文件中。
我保存了更改,然后运行 postfix stop、postfix start。 现在就像一个魅力。
Diago's answer helped me solve the problem I have been trying to figure out.
Our Suse OS also stopped working out of nowhere. Tried every suggestion that I found here and on google. Nothing worked. Tried adding our domain to etc/hosts but that did not help.
Got the hostname of server with the hostname command. Added that hostname to the etc/hosts file just like Digao suggested.
I saved the changes, then ran postfix stop, postfix start. And works like a charm now.
HELO
的参数应该是主机名或 IP 地址。 foo_bar.example.com 既不是 IP 地址也不是主机名(主机名中下划线是非法的),因此错误消息是正确的,没有什么需要修复的。The argument to
HELO
should be a hostname or an IP address. foo_bar.example.com is neither an IP address nor a hostname (underscores are illegal in hostnames), so the error message is correct and there is nothing to fix.使用qmail时我遇到了这个问题。 我意识到这是因为之前未完成的安装。
1)发送电子邮件时,qmail 使用“HELO ...”向其他 SMTP 服务器宣告自己,然后添加文件中的内容:
/var/qmail/control/me
(有时该文件是位于
/var/qmail/control/helohost
)2) 该文件应该有一个主机名,其中包含有效的 DNS 条目。
我的没有
(none)
这是为什么邮件发送失败。Using qmail I came across this problem. I realised this was because of a previously unfinished installation.
1) When sending email qmail announces itself to other SMTP servers with "HELO ..." and then it adds what is in the file at:
/var/qmail/control/me
(sometimes the file is located at
/var/qmail/control/helohost
)2) This file should have a hostname with a valid DNS entry in.
Mine did not it had
(none)
which is why mails were failing to be sent.我发现我的本地开发服务器突然停止发送电子邮件(使用外部 SMTP),并在服务器日志中发现:
127.0.0.1: 8888/app_dev.php 是我的本地 URL,我使用 Docker、Symfony 和 Swift Mailer。
对我的情况有帮助的唯一解决方案是将参数:添加
到我的 Swift Mailer 配置中。 这解决了所有问题。
请参阅 Swift Mailer
local_domain
选项的文档:https://symfony.com/doc/current/reference/configuration/swiftmailer.html#local-domainI found that my local dev server suddenly stopped sending emails (using external SMTP) and on the server logs I found:
127.0.0.1:8888/app_dev.php is my local URL, I am using Docker, Symfony and Swift Mailer.
The only solution that helped in my case was adding the parameter:
to my Swift Mailer configuration. That solved all the problems.
See the docs for the Swift Mailer
local_domain
option: https://symfony.com/doc/current/reference/configuration/swiftmailer.html#local-domain下划线在互联网主机名中实际上是无效的,尽管有些人仍然使用它们。 健全的 DNS 服务器不应允许您拥有它们的记录。
更改系统的主机名,使其有效,希望这能解决问题。
Underscores aren't actually valid in internet host names, despite some people using them anyway. A sane DNS server should not allow you to have records for them.
Change your system's host name so it's valid, hopefully this will fix it.
主机名中下划线可能有问题吗?
http://www.exim.org/lurker/message/20041124.113314.c44c83b2 .en.html
Possibly a problem with underscores in the hostname?
http://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html