sol229 发表于 2018-12-17 10:13:28

linux 下php mail或sendmail发送邮件慢的解决办法

  mail慢并超时是由于sendmail慢引起的,但sendmail慢又如何解决呢?
  第一步:当然是查日志:
  vim /var/log/maillog
  Jul5 23:26:20 localhost sendmail: My unqualified host name (localhost) unknown; sleeping for retry
  Jul5 23:27:20 localhost sendmail: unable to qualify my own domain name (localhost) -- using short name

  Jul5 23:27:20 localhost sendmail: r65FRKmm001206: from=nobody,
size=187,>
  Jul5 23:27:20 localhost sendmail: r65FRKBa001207:
from=,>
  Jul5 23:27:20 localhost sendmail: r65FRKmm001206:
to=aaa@gmail.com, ctladdr=nobody (99/99), delay=00:00:00,
xdelay=00:00:00, mailer=relay, pri=30187,>  Jul5 23:27:22 localhost sendmail: STARTTLS=client,
relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL,
cipher=RC4-SHA, bits=128/128
  Jul5 23:27:25 localhost sendmail: r65FRKBa001207:
to=, ctladdr= (99/99),
delay=00:00:05, xdelay=00:00:05, mailer=esmtp, pri=120398,
relay=gmail-smtp-in.l.google.com. , dsn=2.0.0, stat=Sent
(OK 1373038045 qn3si5112247pbc.62 - gsmtp)
  Jul5 23:30:01 localhost sendmail: My unqualified host name (localhost) unknown; sleeping for retry
  第二步:在hosts表添加域名
  #hostname
  vim /etc/hosts
  如下添加
  ::1   localhost localhost.localdomain localhost6 localhost6.localdomain6 你的域名
我的实例:  

  
::1   localhost localhost.localdomain localhost6 localhost6.localdomain6 itsmtest.vobi××.cn itsm-demo
  

  
root@itsm-demo:/var/www/html/itop.new# service apache2 restart
  
root@itsm-demo:/var/www/html/itop.new# echo $?
  
0
  

  

  

  
我的实例2:没有域名,纯ip地址
  
root@itsm:/var/www/html# cat /etc/hosts
  
127.0.0.1    localhost
  
192.168.200.65    itsm
  

  
# The following lines are desirable for IPv6 capable hosts
  
::1   localhost ip6-localhost ip6-loopback itsm 192.168.200.65
  
ff02::1 ip6-allnodes
  
ff02::2 ip6-allrouters
  如果上面办法还是解决不了
  检查下php.ini设置是否正确
  cat /etc/php.ini | grep sendmail_path
  正确的结果应该类似这样
  sendmail_path = sendmail -t -i
  检查下sendmail是否安装
  which sendmail
  正常的结果应该类似这样
  /usr/sbin/sendmail
  如果上面的路径没有找到sendmail
  检查下是否安装了包
  yum list installed | grep sendmail


页: [1]
查看完整版本: linux 下php mail或sendmail发送邮件慢的解决办法