You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cpanel本地服务器无法发送邮件问题求助

问题:所有cPanel账号无法发送邮件

错误提示

"max defers and failures per hour (5/5 100%) allowed."

已完成的测试操作

1. 端口25监听状态检查

执行命令:netstat -tuplen | grep 25
输出:

[root@serv ~]# netstat -tuplen | grep 25
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      25         30232      2240/pdns_server
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      0          22232      870/exim
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      25         27984      2240/pdns_server
tcp6       0      0 :::111                  :::*                    LISTEN      0          17825      1/systemd
tcp6       0      0 :::25                   :::*                    LISTEN      0          22231      870/exim
tcp6       0      0 :::53                   :::*                    LISTEN      25         27985      2240/pdns_server
udp        0      0 0.0.0.0:53              0.0.0.0:*                           25         27982      2240/pdns_server
udp6       0      0 :::53                   :::*                                25         27983      2240/pdns_server

结论:Exim服务正常监听端口25。

2. 出站端口25连通性测试

执行命令:curl portquiz.net:25
输出:

[root@serv ~]# curl portquiz.net:25
curl: (28) Failed to connect to portquiz.net port 25: Connection timed out

结论:出站端口25连接超时。

3. 防火墙规则检查

执行命令:iptables -L -n | grep :25
输出:

[root@serv ~]# iptables -L -n | grep :25
# Warning: iptables-legacy tables present, use iptables-legacy to see them
ACCEPT     6    --  0.0.0.0/0            0.0.0.0/0            ctstate NEW tcp dpt:25
ACCEPT     6    --  0.0.0.0/0            0.0.0.0/0            ctstate NEW tcp dpt:25
ACCEPT     17   --  0.0.0.0/0            0.0.0.0/0            ctstate NEW udp dpt:25

结论:本地防火墙已放行端口25流量,且ConfigServer Security & Firewall已添加TCP/UDP出站端口25规则。

4. 域名解析测试

执行命令:host server.miexampledomain.com
输出:

[root@server etc]# host server.miexampledomain.com
Host server.miexampledomain.com not found: 3(NXDOMAIN)

结论:服务器自身域名解析失败。

解决方案

1. 解决出站端口25不通问题

从测试结果看,服务器运营商大概率封禁了出站端口25(多数IDC为防垃圾邮件默认封禁)。

  • 直接联系服务器提供商,申请解封端口25;
  • 若无法解封,配置Exim使用替代端口(如587)发送邮件:
    1. 登录cPanel后台,进入Exim Configuration Manager;
    2. 找到SMTP Port选项,添加587作为备用发送端口;
    3. 通知用户调整邮件客户端、脚本的发送端口为587。

2. 重置邮件发送限制

错误提示表明账号1小时内邮件失败/延迟次数已达上限,执行以下操作重置:

  • cPanel后台操作:进入Email Deliverability,找到对应域名,点击Reset按钮重置发送限制;
  • 命令行操作:
    # 删除Exim的延迟/失败计数文件
    rm -f /var/spool/exim/db/defer* /var/spool/exim/db/fail*
    # 重启Exim服务
    systemctl restart exim
    

3. 修复域名解析问题

域名解析失败会影响邮件HELO验证、反向解析,导致发送失败,操作如下:

  • 登录域名DNS管理后台,确认server.miexampledomain.com的A/AAAA记录已正确指向服务器公网IP;
  • 若使用本地PowerDNS,检查DNS区域配置,确保该域名已添加正确记录;
  • 刷新DNS缓存:
    systemctl restart pdns
    
  • 验证解析:执行dig server.miexampledomain.com,确认返回正确IP。

内容的提问来源于stack exchange,提问作者Esteban Cabrera Gómez

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 15:13:16