如何修复“501 语法无效的 HELO 参数”?

发布于 2024-07-05 16:03:33 字数 169 浏览 5 评论 0原文

我在发送主机和中继主机上都使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

握住你手 2024-07-12 16:03:33

在花了这么多时间试图解决这个问题之后,在我的例子中,这个问题是从无到有的,我最终找到了一个解决方案。 就我而言,只有部署到 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.

站稳脚跟 2024-07-12 16:03:33

迪亚戈的回答帮助我解决了我一直想弄清楚的问题。

我们的 Suse 操作系统也突然停止工作。 尝试了我在这里和谷歌上找到的每一个建议。 什么都没起作用。 尝试将我们的域添加到 etc/hosts 但这没有帮助。

使用hostname命令获取服务器的主机名。 就像 Digao 建议的那样,将该主机名添加到 etc/hosts 文件中。

127.0.0.1 localhost susetest

我保存了更改,然后运行 ​​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.

127.0.0.1 localhost susetest

I saved the changes, then ran postfix stop, postfix start. And works like a charm now.

冰雪之触 2024-07-12 16:03:33

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.

痞味浪人 2024-07-12 16:03:33

使用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.

一曲琵琶半遮面シ 2024-07-12 16:03:33

我发现我的本地开发服务器突然停止发送电子邮件(使用外部 SMTP),并在服务器日志中发现:

从 cpc96762-********.net [..**.68] 拒绝了 EHLO:语法无效的参数:127.0.0.1:8888/app_dev.php< /p>

127.0.0.1: 8888/app_dev.php 是我的本地 URL,我使用 Docker、Symfony 和 Swift Mailer。

对我的情况有帮助的唯一解决方案是将参数:添加

local_domain = "localhost"

到我的 Swift Mailer 配置中。 这解决了所有问题。

请参阅 Swift Mailer local_domain 选项的文档:https://symfony.com/doc/current/reference/configuration/swiftmailer.html#local-domain

I found that my local dev server suddenly stopped sending emails (using external SMTP) and on the server logs I found:

rejected EHLO from cpc96762-*******.net [..**.68]: syntactically invalid argument(s): 127.0.0.1:8888/app_dev.php

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:

local_domain = "localhost"

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

嗼ふ静 2024-07-12 16:03:33

下划线在互联网主机名中实际上是无效的,尽管有些人仍然使用它们。 健全的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文