Redirect local emails to a remote email account
My previous post is a guide for setting up exim4, an SMTP mail server, to use Gmail as a smarthost. One reason for setting up a mail server is to redirect my local root emails to an Internet email account that I actually monitor. In this way, I won't miss any security alert sent to the localroot mailbox.
This post shows you how to set up email redirection. The instructions are similar for various mail servers: exim4, Postfix, or sendmail.
- Set up an SMTP server.
- Edit /etc/aliases as root.
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: peterTo the left of the colon is the mail alias defined on the local machine. You can send email to a local email alias, say security and the message will be redirected to the account(s) specified to the right of the colon.
In many default mail server configurations, emails to any alias are forwarded to root. But often root itself is not redirected to a regularly monitored email account.
- Redirect root.
Replace the root: peter line with the line below using your personal email address:
root: yourAddress@gmail.com
- Rebuild alias database.
$ newaliases
For sendmail, and Postfix, after you modify the alias file, you need to run the newaliasescommand to rebuild the mail alias database. For exim4, this step is not required because it relies solely on the alias file and NO database.
To test, send root an email, and verify that the message is delivered to the target remote email account.
$ echo 'Code red'| mail -s 'Hacker Alert' root
Redirect local emails to a remote email account的更多相关文章
- Step by step Install a Local Report Server and Remote Report Server Database
原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...
- Golang : Forwarding a local port to a remote server example
原文:https://socketloop.com/tutorials/golang-forwarding-a-local-port-to-a-remote-server-example 端口转发, ...
- What is the difference between XSS and CSRF from their execution perspective?
What is the difference between XSS and CSRF from their execution perspective? https://www.quora.com/ ...
- SSH的端口转发:本地转发Local Forward和远程转发Remote Forward
关于使用ssh portforwarding来进行FQ的操作,网络上已经有很多很好的文章,我在这里只是画两个图解释一下. 首先要记住一件事情就是: SSH 端口转发自然需要 SSH 连接,而 SSH ...
- 菜鸟学EJB(二)——在同一个SessionBean中使用@Remote和@Local
不废话.直接进入正题: 在Jboss4及曾经的版本号中,例如以下代码能够成功部署: package com.tjb.ejb; import javax.ejb.Local; import javax. ...
- EJB Remote/Local 绑定和JNDI Lookup
从同事那里学到一种方便的注解SessionBean的方式.代码我放到github去了 https://github.com/EdisonXu/Test/commit/703d49123dca9e666 ...
- SSRS2:Reporting Service 配置Service Account
1,Service Account SSRS以一个Service方式实现,有三部分组成:Web Service,Report Manager和一个后台的进程,这个Service运行的账号就是Servi ...
- How to get started with GIT and work with GIT Remote Repo
https://www.ntu.edu.sg/home/ehchua/programming/howto/Git_HowTo.html#zz-7. 1. Introduction GIT is a ...
- How to Verify Email Address
http://www.ruanyifeng.com/blog/2017/06/smtp-protocol.html 如何验证 Email 地址:SMTP 协议入门教程 https://en.wiki ...
随机推荐
- Python基础部分的疑惑解析(1)
Python介绍: 是一种全能的语言,虽然执行效率低,但是开发效率高 现在也存在多种版本,IPYTHON,JPYTHON,但最重要的是CPYTHON,其他都是作用于各种语言的粘合剂版本,执行效率低,C ...
- vue 在 html 中自定义 tag
v-if,v-for,:key,:style,v-text,@click,:src,:poster,:class,:href
- springboot(十四)-分库分表-自动配置
上一节我们是手动配置数据源的,直接在java代码里写数据库的东西,这操作我个人是不喜欢的.我觉得这些东西就应该出现在application.yml文件中. 还有,万一我们的项目在使用之后,突然需要改变 ...
- Windows开发经验 - WinDbg
1. 远程调试 参考文章:https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/remode-debugging-usi ...
- php正则验证邮箱、手机号、姓名、身份证、特殊符号等
1.邮箱验证 1 $email='1515212@qq'; 2 $preg_email='/^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@([a-zA-Z0-9]+[-.])+( ...
- 修改hosts文件的脚本1.0
import sys IP_input = input("Please input IP:")DNS_input = input("Please input Domain ...
- Centos7安装python3.7.1并与python2共存
转自:http://www.cnblogs.com/JahanGu/p/7452527.html参考:https://www.jb51.net/article/104326.htm 1. 备份原来的p ...
- getActionBar()为null的解决方法总结(引用他人)
最近在看android actionBar的使用,环境为AndroidStudio,建一个简单的工程,功能为:两个按钮,一个单击用于显示actionbar,一个用于隐藏actionbar.默认acti ...
- Javascript框架设计思路图
这个系列的随笔都是关于Javascript框架设计一书的读书笔记(作者是司徒正美),不是本人原创!!! 一.简介: 1.市面上主流的JS框架,大多数是由一个个模块组合而成,模块化是大多数让软件所遵循的 ...
- Intellij Idea快捷鍵
一.视图查看 Ctrl+F12 查看file,method结构图.类继承机构图 (不知道方法结构,Ctrl+F12一下,方法,参数,返回值,一清二楚的展现出来) Ctrl+shift+Alt+U ...