前言

Linux--mail邮件命令

/var/spool/mail/root 中有新邮件 这个问题应该是网络混乱状态 还有就是root给管理员账户发送的报错。

报错如下:

1  命令说明

指令名称:mail

指令所在路径:/bin/mail

执行权限:所有用户

语法:mail [用户名]    此处的用户无论当前是否在线都可以

功能描述:查看发送电子邮件

范例:#mail root

1.2  应用举例

1.2.1  给root用户发送邮件

命令演示:

[root@localhost~]# mail root

Subject:the application of mail

today, I want tolearn the command of mail

It seems not sodifficult !

根据提示输入邮件标题和内容,按Ctrl+c键保存结束。

操作示意图如图1所示:

图1  给root用户发送邮件

需要说明的是:mail命令的执行利用的并不是目前我们已经搭建好的邮件服务器。即:如果是本机用户给本机用户发送邮件,利用的就是本地的内存。也就是说当前的linux系统并没有搭建邮件服务器,甚至是网络都不通,也能通过mail命令发送邮件。当前如果是要给真正的互联网邮箱发送邮件,那么就必须要求网络畅通了

1.2.2  root用户接收和查看邮件内容

命令演示:

[root@localhost~]# mail

Heirloom Mailversion 12.4 7/29/08.  Type ? for help.

"/var/spool/mail/root":1 message 1 new

>N  1 root                  Sat Jul 30 05:49  19/685  "the application of mail"

&

操作示意图如图2所示:

图2  接收和查看邮件内容

邮件内容信息说明:

N:New,表示该邮件是新邮件,还未读。若该邮件已读,则该位置的N字母将不会再显示。

1:表示邮件序号。(此处表示第一封邮件)

root:表示邮件的发送发

Sat Jul 30 05:49:邮件发送日期和时间

"theapplication of mail":邮件的主题

"theapplication of mail":邮件保存的邮箱具体位置。

1.2.3  邮件交互界面可进行的操作

在“&”输入提示符后面输入help命令,查看该界面支持的相关命令。

& help

mail commands

type type messages

next                            goto and type nextmessage

from give head lines ofmessages

headers                         print out activemessage headers

deletedeletemessages

undeleteundeletemessages

save folder      append messages tofolder and mark as saved

copy folder      append messages tofolder without marking them

writefile       appendmessage texts to file, save attachments

preservekeepincoming messages in mailbox even if saved

Replyreply to message senders

replyreply tomessage senders and all recipients

mailaddresses                  mail tospecific recipients

file folder                     change to another folder

quit                            quit and applychanges to folder

xit                             quit and discardchanges made to folder

!                               shell escape

cdchdirto directory or home if none given

list                            list names of allavailable commands

A consists of integers, ranges of same, or other criteria

separated byspaces.  If omitted, mail uses the lastmessage typed.

操作示意图如图3所示:

图3  help命令查看邮件交互界面支持的相关命令

在该交互界面直接输入邮件序列号,就可以查看指定邮件的具体内容:

& 1

Message  1:

Fromroot@localhost.localdomain  Sat Jul 3005:49:18 2016

Return-Path:

X-Original-To:root

Delivered-To:root@localhost.localdomain

Date: Sat, 30Jul 2016 05:49:17 +0800

To:root@localhost.localdomain

Subject: theapplication of mail

User-Agent:Heirloom mailx 12.4 7/29/08

Content-Type:text/plain; charset=us-ascii

From:root@localhost.localdomain (root)

Status: R

today, I want tolearn the command of mail

It seems not sodifficult !

操作结果示意图如图4所示:

图4  查看指定邮件的具体内容

此时若想回到之前的邮件显示列表,可在该交互界面输入字符“h”,操作结果显示如图5所示:

图5  返回邮件显示列表

如果想要删除邮件,可在该交互界面输入命令:d 邮件序号

若要退出当前交互界面,按q键即可。

操作结果示意图如图6所示:

图6  删除邮件操作

注意:mail命令的关键作用在于方便root用户及时查看系统信息邮件。

有时候系统会给root用户发送一些系统信息邮件。所以当我们root登录系统之后,系统就会提示有新的邮件,需要接收。

系统给root用户发送的邮件信息都是非常重要的。比如说日志的统计信息,还有一些系统的报错信息。所以,当收到root的邮件信息提示时,一定要及时仔细查看,因为很有可能系统在运行的过程中出现了一些问题了,有可能会影响到系统的稳定和安全。

linux提示有新邮件,/var/spool/mail/root 中有新邮件 解决方法相关推荐

  1. Centos 7 如何关闭提示(You have new mail in /var/spool/mail/root)

    文章目录 You have new mail in /var/spool/mail/root You have new mail in /var/spool/mail/root 对于linux 学习者 ...

  2. 解决Centos7关闭You have new mail in /var/spool/mail/root提示

    一.问题 运行一个命令就会出现"You have new mail in /var/spool/mail/root "很烦人. [root@HP110 ~]# touch demo ...

  3. Linux有时会出现“You have new mail in /var/spool/mail/root”

    此文章转自峰云:http://rfyiamcool.blog.51cto.com/1030776/413145 Linux有时会出现"You have new mail in /var/sp ...

  4. You have new mail in /var/spool/mail/root消除提示的方法

    有时在进入系统的时候经常提示You have new mail in /var/spool/mail/root 你觉得烦人---解决方法: 修改系统配置文件/etc/profile,告诉系统不要去检查 ...

  5. Centos中提示You have new mail in /var/spool/mail/root 解决

    echo"UNSET  EMAILCHECK">>/etc/profile soure /etc/profile 查看 ls -lth  /var/spool/mail ...

  6. 禁止显示“You have new mail in /var/spool/mail/root”

    linux系统,如centos下默认在收到收件是会在执行命令后显示提示 "You have new mail in /var/spool/mail/root" , 这个消息有时候是 ...

  7. You have mail in /var/spool/mail/root

    转载http://www.fedora.hk/linux/yumwei/show_17.html 安装完LINUX后经常使用终端远程登录,登录后经常出现You have new mail in /va ...

  8. You have new mail in /var/spool/mail/root

    在服务器上敲Linux命令的时候,下面会多一行命令:You have new mail in /var/spool/mail/root 这个是干啥的? Linux 系统经常会自动发出一些邮件来提醒用户 ...

  9. you have new email in /var/spool/mail/root/

    有时在进入系统的时候经常提示You have new mail in /var/spool/mail/root 解决方法:修改系统配置文件/etc/profile,告诉系统不要去检查邮箱. 具体操作: ...

最新文章

  1. 改革以来计算机应用发展总结,计算机应用专业课程改革总结.doc
  2. 设置按峰值带宽计费_如何理解串联谐振电路中的带宽?
  3. 海底捞涨价,有错吗?
  4. html loader的作用,webpack认识loader的作用
  5. 史上最简单的决策树模型讲解
  6. Google Chrome 浏览器插件开发学习
  7. Spring MVC No converter found for return value of type
  8. JSP Include 文件方式
  9. cookie 以及session 的使用
  10. 盘点下常用的接口测试工具,有几个你肯定没用过
  11. 华为IS-IS基础配置
  12. 20.Mybatis之逆向工程
  13. 用好这两大office模板资源网,办公轻松又高效
  14. jdk7 linux 32位 安装包 微云网盘下载
  15. 中望cad自定义快捷键命令_中望CAD快捷键全集
  16. 新浪微博SSO登陆机制
  17. Android界面美化的一点点积累
  18. 格式化日期之YYYY与yyyy
  19. 3D Dirichlet Free-Form Deformation(三维Dirichlet自由变形)
  20. 架构-分布式与集群的区别

热门文章

  1. 大数据技术平台主要分为哪几类
  2. 物联网卡对企业设备的重要性
  3. C++算法学习(力扣:201. 数字范围按位与)
  4. android程序安装空间不足,AndroidStudio提示磁盘空间不足
  5. Python3.x+pycharm+Anaconda中缩小打包的.exe体积的方法
  6. python报表自动化系列 - 获取指定目录所有文件绝对路径
  7. mysql 5.7 编译_MySQL5.7.20编译安装
  8. AcWing 837. 连通块中点的数量
  9. mysql large pages_Innodb内存管理解析
  10. python - 机器学习lightgbm相关实践