2

I'm running a Ubuntu 12.04lts server with denyhosts, logwatch, apticron etc daemons which send emails to a user on the machine when something happens.

Since I don't use the root account; I aliassed everything which goes to the root to my own superuser account:

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

The mail now gets delivered to my richard account. To forward every mail externally I added this line:

richard: [email protected], richard

The hostname of the server is srv1.domain.com. I don't want to receive external mail on this machine. I just want the local mail originating from the machine being forwarded to my, hosted on google business apps, remote mail.

How can I configure exim (at least I think that is the default MTA of ubunutu) to do the above?

2 Answers 2

1

It's easiest to run dpkg-reconfigure exim4-config. For the first question (what type of mail configuration), you can probably just leave whatever is selected. For the second question (what IP addresses to listen on), you want it to listen on 127.0.0.1 and ::1 (the ipv4 localhost and the ipv6 localhost). Answer the rest of the questions and save.

Since Ubuntu just repackages the Debian version of exim4, you should read the detailed Debian instructions located at http://pkg-exim4.alioth.debian.org/README/README.Debian.html. This same file is usually locally installed on your system at /usr/share/doc/exim4-config/README.Debian.gz too.

2
  • Thank you! After all it was fairly simple answering the questions of exim4-config! So I don't have to be afraid the server will be used for spam if I pu the listen addresses on 127.0.0.1 and ::1 ?
    – stUrb
    Apr 6, 2013 at 2:17
  • It won't be used for spamming by connecting from the outside to your mail server via smtp. However, you also need to make sure that any webpages that you have on your webserver don't send mail based on user input into forms. THAT is also a big exploitable source of spam.
    – Todd Lyons
    Apr 10, 2013 at 20:10
0

You can:

Make exim accept SMTP connections only on loopback interface (127.0.0.1:25) - see local_inteffaces configuration option. It is a pretty common default MTA configuration.

OR

Turn off waiting/accepting SMTP connections.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .