从机器/进程发送邮件到外部机器

我运行的Ubuntu 12.04lts服务器与denyhosts,logwatch,apticron等守护进程发送电子邮件给机器上的用户,当发生什么事情。

由于我不使用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: richard 

邮件现在被传送到我的richard账户。 为了转发每一封邮件,我添加了这一行:

 richard: [email protected], richard 

服务器的主机名是srv1.domain.com。 我不想在这台机器上收到外部邮件。 我只是想从机器发出的本地邮件被转发到我的,托pipe在谷歌业务应用程序,远程邮件。

如何configurationexim(至less我认为这是ubunutu的默认MTA)来做到这一点?

运行dpkg-reconfigure exim4-config最简单。 对于第一个问题(什么types的邮件configuration),你可能只是留下所选的东西。 对于第二个问题(要监听的IP地址),您希望它监听127.0.0.1和:: 1(ipv4 localhost和ipv6 localhost)。 回答其余的问题并保存。

由于Ubuntu只重新包装了Debian版本的exim4,所以您应该阅读位于http://pkg-exim4.alioth.debian.org/README/README.Debian.html的 Debian详细说明。 同样的文件通常在你的系统上安装在/usr/share/doc/exim4-config/README.Debian.gz。

您可以:

使exim仅在回送接口(127.0.0.1:25)上接受SMTP连接 – 请参阅local_inteffacesconfiguration选项。 这是一个非常常见的默认MTAconfiguration。

要么

closures等待/接受SMTP连接。