當前位置:才華齋>IT認證>Linux認證>

Linux認證系統管理:linuxmail命令傳送郵件失敗

Linux認證 閱讀(9.18K)

使用linux自帶的'郵件功能測試郵件傳送功能如下:

Linux認證系統管理:linuxmail命令傳送郵件失敗

$ mail -s test

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:

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

Message-Id: <3ZSPe006446@ltv_73>

To:

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 []

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

(reason: 530 5.7.1 Client was not authenticated)

----- Transcript of session follows -----

e talking to .:

>>> MAIL From: 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;

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/

修改成可用的DNS,這個地方的修改儲存後即生效;

3.修改主機名【也可不做這一步】

$ sysctl name=newhostname

4.重啟郵件服務

$ service sendmail restart