我在 Ubuntu 10.04 上安装了 sendmail,仅用于 phpmail()
功能。这工作正常,除非 iptables 正在运行(我一直在sendmail myemailaddress@domain.com
用来测试这个)。
我认为我已经允许 SMTP 和 DNS(我用来测试 iptables 规则的脚本如下,在我的版本中是我的主机名称服务器的实际 IP),但无济于事!
iptables --flush
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Postgres
iptables -A INPUT -p tcp --dport 5432 -j ACCEPT
# Webmin
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
# Ping
iptables -A INPUT -p icmp --icmp-type echo-request …
Run Code Online (Sandbox Code Playgroud)