remington_young 发表于 2015-11-25 11:30:27

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?
xinhaozheng@gmail.com... Connecting to via relay...
xinhaozheng@gmail.com... Deferred: Connection timed out with
  
  怀疑是ISP封掉了25端口。检查一下防火墙,暂时关掉iptables,再用这个命令测试,可以通过:
  
  WARNING: local host name (server) is not qualified; see cf/README: WHO AM I?
xinhaozheng@gmail.com... Connecting to 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 , 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:<xinhaozheng@gmail.com>
>>> DATA
250 2.1.5 <xinhaozheng@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o3T1Mg5Z016990 Message accepted for delivery
xinhaozheng@gmail.com... Sent (o3T1Mg5Z016990 Message accepted for delivery)
Closing connection to
>>> QUIT
221 2.0.0 server closing connection
页: [1]
查看完整版本: Linux -- 测试sendmail邮件发送