Change root@hostname to different email address

By default, any email sent by system is sent to root@hostname. So critical server errors, log errors, corn jobs alerts e.t.c all are sent to this default email address. To change it to different appropriate email id, we can do this by two ways.

By updating email aliases file:

For this example, lets set email to system@mydomain.com

Step 1 : edit /etc/aliases file

$ vi /etc/aliases

Add email ids at the bottom of the file.

root: system@mydmomain.com

To add multiple email ids, we can simply separate them by comma.

root: system@mydomain.com, linux@mydomain.com

linux@mydomain.com is second email id 

Step 2: Run the aliases command, to compile aliases file.

$ newaliases

Step 3: Restart postfix server.

service postfix restart

Second way:

We can simply create .forward file to the folder root and add email address there.

$ vi /root/.forward
system@mydomain.com

Restart postfix server
$ service postfix restart.

That’s it. Enjoy!

来源:https://anandarajpandey.com/2014/09/10/how-to-change-default-root-email-address-linux-postfix-centos/

How to change default root@ email address linux / postfix / centos?的更多相关文章

  1. Change default network name (ens33) to old “eth0” on Ubuntu 18.04 / Ubuntu 16.04

    Change default network name (ens33) to old “eth0” on Ubuntu 18.04 / Ubuntu 16.04 By Raj Last updated ...

  2. git中报unable to auto-detect email address 错误的解决拌办法

    昨天刚配置好的git,今天刚要commit一些修改,就遇到了这个问题** Please tell me who you are. Run git config --global user.email ...

  3. How to Verify Email Address

    http://www.ruanyifeng.com/blog/2017/06/smtp-protocol.html  如何验证 Email 地址:SMTP 协议入门教程 https://en.wiki ...

  4. fatal: unable to auto-detect email address (got 'tim@newton.(none)')的解决方法

    问题描述: 使用git commit -m "wrote a readme file",就遇到了这个问题** Please tell me who you are. Run git ...

  5. git中报unable to auto-detect email address

    git commit 时报错: ** Please tell me who you are. Run git config --global user.email "you@example. ...

  6. 5 Ways to Send Email From Linux Command Line

    https://tecadmin.net/ways-to-send-email-from-linux-command-line/ We all know the importance of email ...

  7. fatal: unable to auto-detect email address (got 'CC@LAPTOP-UPQ1N1VQ.(none)')

    git 提交问题出现小解决: 在输入 git commit -m "输入的是对这个版本的描述信息" 然后报错:fatal: unable to auto-detect email ...

  8. git commit--fatal: unable to auto-detect email address

    git commit的时候报错 *** Please tell me who you are. Run git config --global user.email "you@example ...

  9. JDK Environment Variable And Change default JDK

    Environment Variable : change(import) /etc/bashrc export JAVA_HOME=/software/jdk1.8.0 export PATH=$J ...

随机推荐

  1. Loadrunner录制+运行+结果-【飞机订票系统实战】

    目录结构: 一.LoadRunner实现订票系统脚本录制 二.Loadrunner实现订票系统IP欺骗(此处可以不设置) 三.Loadrunner运行录制的脚本 四.Load generator配置 ...

  2. Pytest权威教程20-日志

    目录 记录日志 caplog Fixture方法 实时日志 版本改动记录 Pytest3.4中不向后兼容的更改 返回: Pytest权威教程 记录日志 Pytest默认捕获WARNING以上日志消息, ...

  3. php 数组元素加法

    <?php//添加一个元素 $dirs[] = '1location';//再次添加一个元素 $dirs[] = '2location';//第三次添加一个元素 $dirs[] = '3loca ...

  4. mysql in()后子查询优化

    线上数据发现一条数据大量等待的现象,通过explain发现这个sql写法存在问题,这里简单记录一下. 业务场景是这样: 存在购物车和费用两张表,购物车数据是购买商品时生成,用于记录购买商品数据,同时购 ...

  5. SignalR了解

    一.概述 一.理解SignalR ASP.NET SignalR 是为 ASP.NET 开发人员提供的一个库,可以简化开发人员将实时 Web 功能添加到应用程序的过程. 实时 Web 功能是指这样一种 ...

  6. 12.linux上Apache虚拟主机的建立和https协议网站建立

    一.Apache虚拟主机的建立   虚拟web主机 在同一台服务器上建立多个web站点,每个站点不独占用一台真正的服务器       1.建立dns解析 两个域名同一个ip               ...

  7. BDD本质及与ATDD区别

    说起BDD,你会想到什么?   在刚接触BDD(Behavior Driven Development,行为驱动开发)的时候,我以为就是用Cucumber这样的工具来编写场景用例,从而实现自动化测试, ...

  8. vim 替换所有字符串

    将dev 替换 为 prod: :%s/dev/prod/g

  9. Word 软回车和硬回车

    网页上复制一大段内容,会发现很多向下的箭头,这种叫软回车,要如何批量替换成常见的硬回车呢?   工具/原料   word文档 方法/步骤   1 先认识这种向下的箭头,这种回车形式叫软回车,按shif ...

  10. Cesium - Fabric 材质【转官网】

    https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric Fabric Hannah edited this page on 24 Dec ...