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: exim4Postfix, or sendmail.

  1. Set up an SMTP server.
  2. 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: peter

    To 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.

  3. Redirect root.

    Replace the root: peter line with the line below using your personal email address:

    root: yourAddress@gmail.com
    
  4. 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的更多相关文章

  1. 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 ...

  2. Golang : Forwarding a local port to a remote server example

    原文:https://socketloop.com/tutorials/golang-forwarding-a-local-port-to-a-remote-server-example 端口转发, ...

  3. 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/ ...

  4. SSH的端口转发:本地转发Local Forward和远程转发Remote Forward

    关于使用ssh portforwarding来进行FQ的操作,网络上已经有很多很好的文章,我在这里只是画两个图解释一下. 首先要记住一件事情就是: SSH 端口转发自然需要 SSH 连接,而 SSH ...

  5. 菜鸟学EJB(二)——在同一个SessionBean中使用@Remote和@Local

    不废话.直接进入正题: 在Jboss4及曾经的版本号中,例如以下代码能够成功部署: package com.tjb.ejb; import javax.ejb.Local; import javax. ...

  6. EJB Remote/Local 绑定和JNDI Lookup

    从同事那里学到一种方便的注解SessionBean的方式.代码我放到github去了 https://github.com/EdisonXu/Test/commit/703d49123dca9e666 ...

  7. SSRS2:Reporting Service 配置Service Account

    1,Service Account SSRS以一个Service方式实现,有三部分组成:Web Service,Report Manager和一个后台的进程,这个Service运行的账号就是Servi ...

  8. 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 ...

  9. How to Verify Email Address

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

随机推荐

  1. 安卓手机移动端Web开发调试之Chrome远程调试(Remote Debugging)

    一.让安卓打debug模式的apk包 二.将电脑中的chrome升级到最新版本,在chrome浏览器地址栏中输入chrome://inspect/#devices: 在智能手机还未普及时,移动设备的调 ...

  2. Java NIO学习与记录(六): NIO线程模型

    NIO线程模型 上一篇说的是基于操作系统的IO处理模型,那么这一篇来介绍下服务器端基于IO模型和自身线程的处理方式. 一.传统阻塞IO模型下的线程处理模式 这种处理模型是基于阻塞IO进行的,上一篇讲过 ...

  3. SpringMVC初写(四)上传和下载功能的实现

    一.文件上传 流程: 导入包commons-fileuplad组件和依赖包commons-io组件 配置springmvc支持上传的组件: 启动SpringMVC注解支持 配置上传解释器 构建一个上传 ...

  4. Mac 10.12安装Windows远程桌面工具Microsoft Remote Desktop

    说明:之前Office自带的Windows远程桌面工具虽然简便,但是保存的服务器列表有限.而这个微软推出的自家工具可以完美解决这些问题. 下载: (链接:https://pan.baidu.com/s ...

  5. Mac下使用Wine安装文件内容搜索工具Search and Replace

    下载: (链接: https://pan.baidu.com/s/1mij7WX6 密码: xsu8) 安装: 1.安装Wine 参考:http://www.cnblogs.com/EasonJim/ ...

  6. 模块和处理程序之通过HttpModule和HttpHandler拦截入站HTTP请求执行指定托管代码模块

    1.简介 大多数情况下,作为一个asp.net web开发对整个web应用程序的控制是十分有限的,我们的控制往往只能做到对应用程序(高层面)的基本控制.但是,很多时候,我们需要能够低级层面进行交互,例 ...

  7. JS框架设计之命名空间设计一种子模块

    命名空间 1.种子模块作为一个框架的最开始,除了负责初始化框架的最基础部分. 2.种子模块作为框架的最开始,那么什么是种子框架的最开始呢?答案是IIFE(立即调用函数表达式); IIFE(立即调用函数 ...

  8. 用jquery来实现类似“网易新闻”横向标题滑动的移动端页面

    HTML: <div id="navbar"> <div id='navbar_content' style="left:0px;"> ...

  9. spring mongodb中去掉_class列

    调用mongoTemplate的save方法时, spring-data-mongodb的TypeConverter会自动给document添加一个_class属性, 值是你保存的类名. 这种设计并没 ...

  10. Linux 的启动流程--转

    http://cloudbbs.org/forum.php?mod=viewthread&tid=17814 半年前,我写了<计算机是如何启动的?>,探讨BIOS和主引导记录的作用 ...