网站地图    收藏   

主页 > 系统 > linux系统 >

linuxmail命令发送邮件失败的解决 - Linux操作系统:

来源:自学PHP网    时间:2015-04-14 10:28 作者: 阅读:

[导读] 使用linux自带的邮件功能测试邮件发送功能如下:$ mail -s test xxx@163 comsldkfjlskdjf[CTRL 43;D]cc:有时会出再提示:You have a new mail in var spool mail root 并且在邮箱中看不到邮件...

使用linux自带的邮件功能测试邮件发送功能如下:
$ mail -s test xxx@163.com
sldkfjlskdjf[CTRL+D]
cc:

有时会出再提示:
You have a new mail in /var/spool/mail/root
并且在邮箱中看不到邮件;

解决办法:

1. 查看出错的日志
$ tail -n 50 /var/spool/mail/root

From MAILER-DAEMON@ltv_73 Thu Dec 12 11:35:28 2013
Return-Path: <MAILER-DAEMON@ltv_73>
Received: from localhost (localhost)
by ltv_73 (8.13.8/8.13.8) id rBC3ZSPe006446;
Thu, 12 Dec 2013 11:35:28 +0800
Date: Thu, 12 Dec 2013 11:35:28 +0800
From: Mail Delivery Subsystem <MAILER-DAEMON@ltv_73>
Message-Id: <201312120335.rBC3ZSPe006446@ltv_73>
To: <root@ltv_73>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="rBC3ZSPe006446.1386819328/ltv_73"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message

--rBC3ZSPe006446.1386819328/ltv_73

The original message was received at Thu, 12 Dec 2013 11:35:18 +0800
from 41_154 [127.0.0.1]

----- The following addresses had permanent fatal errors -----

(reason: 530 5.7.1 Client was not authenticated)

----- Transcript of session follows -----
... while talking to mail.163.com.:
>>> MAIL From:<root@ltv_73> SIZE=519
<<< 530 5.7.1 Client was not authenticated
554 5.0.0 Service unavailable

--rBC3ZSPe006446.1386819328/ltv_73
Content-Type: message/delivery-status

Reporting-MTA: dns; ltv_73
Received-From-MTA: DNS; sohu_41_154
Arrival-Date: Thu, 12 Dec 2013 11:35:18 +0800

Final-Recipient: RFC822; xxx@163.com
Action: failed
Status: 5.7.1
Diagnostic-Code: SMTP; 530 5.7.1 Client was not authenticated
Last-Attempt-Date: Thu, 12 Dec 2013 11:35:28 +0800

2. 修改DNS
$ vim /etc/resolv.conf
修改成可用的DNS,这个地方的修改保存后即生效;

3. 修改主机名【也可不做这一步】
$ sysctl kernel.hostname=newhostname

4. 重启邮件服务
$ service sendmail restart

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论