Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to set up a CentOS 5.3 server to forward e-mails to another e-mail address. The server doesn't currently have any mail server software installed. What's the simplest way to do this? (aside setting up MX records for the domain)

(I'm aware I could just pick up any mailserver software and configure it to do this, I'd just like to know the simplest solution.)

share|improve this question

As an alternative to setting up your own email server you may want to check with your Domain Name Registrar they often provide low cost email services that would let you do forwarding. A service such as Google Apps would also allow forwarding (and a bunch more) and is easy to setup.

Your milage of course may vary but I've always found the "simplest" servers to be the ones I don't have to setup.

share|improve this answer
Thanks. My situation though is that the customer gave me root to their server and told me "make it work". Having them go and set up something like Google Apps is out of the question, and I think setting up a simple mail server would be easier :) – Vladimir Panteleev Jul 7 '10 at 17:41

How about a transparent proxy? Redirect all incoming port 25 on that machine to the machine of your choice.

share|improve this answer
I could have just as well set the MX records to point to the machine of my choice, no? :) – Vladimir Panteleev Jul 7 '10 at 18:03
..presuming that's possible. If the mailservers are internal and you don't have control of the corporate internal DNS, for instance, that might not be possible. – pjz Jul 13 '10 at 15:06

You could also install somethin like nullmailer, it forwards local mails to a remote smarthost , if that's what you want to do.

If you need to do a little more work, i'd go for postfix or exim which both have A LOT of features :)

share|improve this answer
I need to receive e-mails to that domain from the Internet, though. AFAIK that means I need an SMTP server. – Vladimir Panteleev Jul 7 '10 at 19:18
up vote 0 down vote accepted

It looks like a very simple way to do this is to set up sendmail+esmtp and add a line to /etc/aliases. You can apparently forward to other e-mail addresses using that file. Don't forget to run newaliases after you edited the file.

Will accept this as answer when I confirm it works, and if no one comes up with something better.

share|improve this answer
/etc/aliases is only going to forward to local addresses. It'll put it in the mailbox of whatever user you specify (in /var/spool), but it's not going to forward to an email address on a different machine. I suggest you look at esmtp. It's simple to set up and does exactly what you want. Sendmail compatible, and that will forward mails to an external address. – phresus Jul 7 '10 at 22:08
Ah, forgot to mention esmtp, thanks. – Vladimir Panteleev Jul 7 '10 at 22:23
This doesn't make any sense to me. esmtp is described on its man page as "a send-only sendmail emulator." So does it even have the capability of receiving and forwarding email? (Google also finds "ESMTP" defined as the "Extended Simple Mail Transfer Protocol," but that's not what you're talking about, is it?) – Dave Burton Aug 10 '14 at 1:07
Right. I'm talking about the esmtp Debian/Ubuntu package, which is a relay-only MTA. – Vladimir Panteleev Aug 10 '14 at 8:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.