问题
1.测试邮件插件时,提示:
- 重新部署,只安装emailer插件后,还是提示有错
Caused: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
问题排查
1.重新安装环境后,确保了jenkins是干净的,而任然不工作
2.查看iptables
service iptables status
iptables: Firewall is not running.
3.用telnet进行检查25端口
telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
4.进一点检查25端口,没有返回
lsof -i tcp:25
解决
初步确认是centOs的smtp服务不可用
1.安装postfix
yum -y install postfix
2.启动
postfix start
3.其它命令(stop, reload, abort, flush, check, status)
检测
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 7-19.localdomain ESMTP Postfix
lsof -i tcp:25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 8162 root 12u IPv4 52777399 0t0 TCP localhost:smtp (LISTEN)
smtpd 8309 postfix 6u IPv4 52777399 0t0 TCP localhost:smtp (LISTEN)