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. Codeforces 1264C/1265E Beautiful Mirrors with queries (概率期望、DP)

    题目链接 http://codeforces.com/contest/1264/problem/C 题解 吐槽:为什么我赛后看cf的题就经常1h内做出Div.1 C, 一打cf就动不动AB题不会啊-- ...

  2. 从一个表中往另外一个表中插入数据用到的SQL

    insert into jdjc_zzjcxm (zj,jcxmmc) select sys_guid(),zbmc from JDJC_WHJXXMMC;

  3. python操作toml文件

    # -*- coding: utf-8 -*- # @Time : 2019-11-18 09:31 # @Author : cxa # @File : toml_demo.py # @Softwar ...

  4. go中的方法以及自定义类型代码示例

    package main import "fmt" type user struct { name string age int sex string } type admin s ...

  5. 从零开始带你成为JVM实战高手

    专栏大纲 1.核心gc 内存回收以及提前设置内存大小.

  6. centos7使用MariaDB(转)

    转载文章:https://blog.csdn.net/zwkkkk1/article/details/78444581?locationNum=10&fps=1 最近使用centos7,php ...

  7. keepalived非争抢机制不生效【原创】

    故障现象:俩台服务器设置了keepalived非争抢机制,但是发现优先级高的服务器还是会优先获取vip 利用tcpdump抓包发现只有其中一台服务器,没有另一台 tcpdump -i eth0 vrr ...

  8. 截取完整网页图片的方法 Chrome 浏览器

    截取完整网页图片的方法:https://sspai.com/post/42193 要想使用截图功能,你需要首先确保 Chrome 已升级至 59 或更高版本.在想要截图的网页中,首先按下 ⌘Comma ...

  9. 使用HttpClient访问WebHook

    代码: import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.c ...

  10. mosquitto设置用户名和密码

    https://blog.csdn.net/qq_22111417/article/details/84142509 7.设置用户名和密码 找到用户密码文件在安装bin下: 1: 打开mosquitt ...