VPS 通过设定 25 埠,可以简单有效的防止垃圾邮件问题,详细操作如下:
VPS 预设策略为:
INPUT ACCEPT
FORWARD ACCEPT
OUTPUT ACCEPT
<1>遮蔽全部的 25 埠连线
iptables -A INPUT -p tcp –dport 25 -j DROP
<2>允许特定的 IP 连线 25 埠
iptables -A INPUT -s XX.XX.XX.XX -p tcp –dport 25 -j ACCEPT
<3>禁止特定的 IP 连线 25 埠
iptables -A INPUT -s XX.XX.XX.XX -p -tcp –dport 25 -j DROP
储存后重启才会生效
service iptables save 或 /etc/init.d/iptables save
service iptables restart 或 /etc/init.d/iptables restart