![Exim 配置 - 仅在 25 上监听本地主机](https://linux22.com/image/804717/Exim%20%E9%85%8D%E7%BD%AE%20-%20%E4%BB%85%E5%9C%A8%2025%20%E4%B8%8A%E7%9B%91%E5%90%AC%E6%9C%AC%E5%9C%B0%E4%B8%BB%E6%9C%BA.png)
我想使用 Exim4 作为我服务器的 MTA,但基本上只用于发送电子邮件。出于安全问题,我想将传入连接限制为仅本地主机(我认为)。因此,在 exim4 配置中有此选项,您可以在其中指定:
用于监听传入 SMTP 连接的 IP 地址:
如果我将 localhost 放在那里,我可以通过 mutt 和 mail 完美地发送电子邮件,但我的机器上的其他服务无法连接到 exim 守护进程来发送电子邮件,特别是因为无约束力如果我在上面的字段中指定了 localhost,则到端口 tcp/25。
当然,如果我将该字段留空,一切都会正常工作,但我不想为我自己的机器以外的任何人监听 tcp/25...当所有连接都被接受时,对于像 ossec 这样的本地服务,这是我的日志:
2013-10-08 12:26:13 1VTcv7-XXXXX-XX <=[电子邮件保护]H=本地主机(notify.ossec.net)[127.0.0.1] P=smtp S=979
答案1
如果您确实在该设置中输入了“localhost”,请尝试输入:
dc_local_interfaces='127.0.0.1 ; ::1'
期间dpkg-重新配置 exim4-config,如果选择类型为“*Internet 网站”,则第二个问题如下所示:
Please enter a semicolon-separated list of IP addresses. The Exim SMTP listener
daemon will listen on all IP addresses listed here.
An empty value will cause Exim to listen for connections on all available network
interfaces.
If this system only receives mail directly from local services (and not from other
hosts), it is suggested to prohibit external connections to the local Exim daemon.
Such services include e-mail programs (MUAs) which talk to localhost only as well
as fetchmail. External connections are impossible when 127.0.0.1 is entered here,
as this will disable listening on public network interfaces.
IP-addresses to listen on for incoming SMTP connections:
只需在该字段中输入以下内容:
127.0.0.1; ::1
答案2
答案3
如果您没有使用基于 debian 的配置,则一般配置指令是:
local_interfaces = 127.0.0.1.25
# At least, when assuming this:
disable_ipv6 = true