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/

最新文章

  1. Jquery 页面间传值(非QuerryString)
  2. java 测试:iterator foreach for 三种迭代方式哪种更快?
  3. HDU 4859 海岸线(最大流最小割)
  4. Mysqli封装
  5. sharepoint多个NLB的web前段如何进行文件同步?
  6. [工作积累] Google/Amazon平台的各种坑
  7. 创建动态组-以OU为单位
  8. Objective-c开发中混合使用ARC
  9. 扒一扒ReentrantLock以及AQS实现原理
  10. 老李分享:loadrunner用javavuser进行接口测试
  11. 驰骋工作流引擎JFlow与activiti的对比 -总结
  12. [angularjs] angularjs系列笔记(三)模型
  13. 16.3-uC/OS-III同步 (事件标志组实验)
  14. Go语言之高级篇beego框架之模型(Models)
  15. iOS开发-观察者模式
  16. [3]windows内核情景分析--内存管理
  17. 2018.10.26 NOIP模拟 图(最小生成树+线段树合并)
  18. 最高频的K个单词 · Top K Frequent Words
  19. jmeter—操作数据库
  20. Python 各种编码相互转化 (目前只有Unicode utf-8)

热门文章

  1. Java 中List集合中自定义排序
  2. nginx 配置的server_name参数
  3. .netFramework 升级NetCore 问题汇总及解决方案
  4. mac安装rust的pyo3模块
  5. PostgreSQL查看版本信息
  6. 咏南中间件随LINUX开机自动启动
  7. Qt Creater-特殊注释TODO,FIXME
  8. longitudinal models | 纵向研究 | mixed model
  9. Windows和Linux下putenv()函数导致composer更新失败
  10. MySQL按日期分组并统计截止当前时间的总数(实例教程)