Linux -- 测试sendmail邮件发送

又碰到邮件问题,在magento前台注册新用户,下订单都没有收到邮件。但是提示都是说正常。

 

直接在ssh中使用下列命令测试,连接超时:

 

echo "Subject: test" | /usr/lib/sendmail -v xinhaozheng(at)gmail.com

(注:很多人在测试时直接把命令复制进去测试,导致我收到了N多的测试邮件。)

 

提示:

 

WARNING: local host name (server) is not qualified; see cf/README: WHO AM I?
[email protected]... Connecting to [127.0.0.1] via relay...
[email protected]... Deferred: Connection timed out with [127.0.0.1]

 

怀疑是ISP封掉了25端口。检查一下防火墙,暂时关掉iptables,再用这个命令测试,可以通过:

 

WARNING: local host name (server) is not qualified; see cf/README: WHO AM I?
[email protected]... Connecting to [127.0.0.1] via relay...
220 server ESMTP Sendmail 8.13.8/8.13.8; Thu, 29 Apr 2010 03:22:42 +0200
>>> EHLO server
250-server Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@server> SIZE=14
250 2.1.0 <root@server>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
250 2.1.5 <[email protected]>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o3T1Mg5Z016990 Message accepted for delivery
[email protected]... Sent (o3T1Mg5Z016990 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 server closing connection

你可能感兴趣的:(linux,server,防火墙,测试,ssh,Magento)