Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

4 Answers 4

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 :) –  CyberShadow Jul 7 '10 at 17:41
add comment

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? :) –  CyberShadow 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
add comment

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. –  CyberShadow Jul 7 '10 at 19:18
add comment
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. –  CyberShadow Jul 7 '10 at 22:23
add comment

Your Answer

 
discard

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.