早上在服务器上查问题的时候,偶然发现,在tail -f /var/log/mesage 中发现有这个日志报错,

cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large

Earlier today while looking into an issue on a CentOS Linux server I noticed an error message in the maillog file. The mail server running on this Linux server is Postfix and it appeared to have been complaining of the size of root’s mailbox located at /var/mail/root. When I first started investigating I figured I was going to see root’s mailbox at a size of 1GB or 2GB but I was surprised when looking into the issue that root’s mailbox was only about 48MB in size so at first I thought there might be another problem. After some digging around in /etc/postfix I figured out that Postfix limits the size of local mailboxes to 51200000 bytes or 48.8MB. Below is information on how I discovered the issue as well as how to modify the size that Postfix limits local mailboxes to.

可以使用postconf -n来查看,相关的配置信息,如下;

[root@localhost ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

该问题主要原因是因为在postfix配置文件main.cf.default

mailbox_size_limit = 51200000(50M)

也就是说当用户的对应的/var/mail/USERNAME 文件的大小不能超过50M 如果超出该值时可能会出现只能发送不能接受的情况。

解决方法:

是重新设置 postfix main.cf.default 配置文件中对应 mailbox_size_limit=51200000

修改为 mailbox_size_limit=0 把值改为零的情况下,就是不限制

或:

[root@localhost ~]# postconf -e mailbox_size_limit=0

在修改完postfix maincf.deafault 配置文件时,需要重新加载postfix  service  postfix  reload

Linux - cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large相关推荐

  1. You have mail in /var/mail/root

    文章目录 关闭邮件提醒 取消自动关闭窗口 关闭邮件提醒 随便输入命令就提示You have mail in /var/mail/root,这里提供一下关闭的方法: You have mail in / ...

  2. Linux无法登陆,var目录权限修改导致SSH失败

    1.问题说明 Linux远程服务器突然无法SSH登录了, 登陆报错: ssh_exchange_identification: read: Connection reset by peer. 2.问题 ...

  3. 关于linux下/srv、/var和/tmp的职责区分

    /srv :主要用来存储本机或本服务器提供的服务或数据.(用户主动生产的数据.对外提供服务) /srv contains site-specific data which is served by t ...

  4. Linux系统下区别对比(~、/home与/root)

    Linux系统下区别对比(~./home与/root) Linux下~./home与/root的区别: 1.在root用户下,~等同于/root 2.在普通用户下,~等同于/home/当前的普通用户名 ...

  5. ubuntu之Unable to lock the administration directory(/var/lib/dpkg/), are you root?13 Permission denie

    apt-get install subversion E: 无法打开锁文件 /var/lib/dpkg/lock - open (13 Permission denied) E: Unable to ...

  6. ubuntu 改linux密码忘了怎么办,Ubuntu 14.04忘记root密码的解决方法

    电脑20多天没用,忘记Ubuntu 14.04 root密码了,下面是在网上找到的一个解决办法,其它的和这个也大概相同.因为其中有些缺漏,没能给我解决问题.通过分析最终问题还是解决了,现解决方案的关键 ...

  7. linux mysql降权_怎样将mysql数据库root降权

    展开全部 一.用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpa ...

  8. 【Linux】用户和用户组|将用户添加到root组中

    添加组 usermod -a -G root dev 修改dec的用户组为root usermod -g root dec 删除组用户dev的用户组root gpasswd -d dev root 将 ...

  9. mysql知识系列:查看用户密码、修改用户密码,对网上“update user set authentication_string=‘123456’ where user=‘root’;”纠错

    说明: 博主用的是mysql8.0.18,网上在找回mysql密码,清一色的教程都是修改root用户的密码,并且使用" update user set authentication_stri ...

最新文章

  1. 高薪诚聘 | 匠韵智能招聘3D视觉工程师
  2. Delphi XE 使用 MySQL 数据库一个奇怪的问题
  3. leetcode-Excel Sheet Column Title
  4. java类结构工具_java类层次结构图工具
  5. 新建android模拟器无法拨号 真机可以拨号,自己想弄个手机拨号器,可是在模拟器上没有反应,能帮帮忙吗?...
  6. python 安装容易吗,Python安装的步骤操作其实是件很容易的事
  7. fread读取同一个文件得到缓冲区大小不同_c++日志文件操作
  8. `ll/sc` 指令在`linux`中的软件实现
  9. python输入一个字母标识符_Python基础入门语法和变量类型(一)
  10. 查询检测PhysX 3.2中的场景查询(1)-基础
  11. Atitit 算法之道 attilax著 1. 第二部分(Part II) 排序与顺序统计(Sorting and Order Statistics) 1 2. 第六章 堆排序(Heapsort)
  12. 【HTML简易版“冒险岛”小游戏】(游戏效果展示+全部源代码分享)
  13. 【git】git的删除命令与如何删除仓库文件的方法
  14. HBase shell删除表失败:ERROR: Table user is enabled. Disable it first.
  15. MYSQL基础教程书籍
  16. 首先,打破一切常规 学习笔记 之二
  17. 卷积神经网络CNN——使用keras识别猫咪
  18. 深信服售前产品经理面试准备材料(更新ing)
  19. 测绘资质-地理信息系统工程
  20. 《数学之美》一些知识

热门文章

  1. NSSCTF web学习
  2. mysql eav_Magento的EAV模型窥探
  3. 【css滤镜】高级属性filter
  4. VuePress 博客之 SEO 优化(一) sitemap 与搜索引擎收录
  5. w7电脑蓝屏怎么解决_教您电脑蓝屏怎么办
  6. Hbuilder中如何快速输入注释标签_vscode中20个让人眼前一亮的插件
  7. 基于YOLO目标检测及OpenCV实现的游戏代玩人工智能体(Auto Gaming Agent) [4]
  8. java 5,8,9章复习
  9. 用C语言程序算交税,用C语言编写函数InComeTax计算七级累进税率的税后收入
  10. vs2008配置opencv2.4.0