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