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 am attempting, for the first time, to set up an email server. So far, I have postfix and dovecot running on my CentOS server (hosted at rackspace). It has 3 interfaces: localhost, internal network, and public network (the world). I am accessing my mailbox on the server via ssh with port forwarding from my local machine. So, any requests I make look like they are coming from localhost from the perspective of the server.

I have dovecot set up have emails at ~/Maildir and I have postfix set up to send emails to local users there.

With port 25 open to the public network, I can receive emails from external servers (like yahoo) just fine. However, I don't want to become a target for spambots and be used as a relay.

I currently do not have port 25 open to the public network and postfix is only listening on the localhost. Of course, sending emails from my yahoo account to one of the local users doesn't go through. Here is what I think would work, but I have no idea how to do:

  • Have emails to local users accepted from any interface on postfix (so I can receive emails). Obviously, I will open port 25 on the public network.
  • Emails to external users can only be accepted from localhost (to protect from spammers relaying mail through my server)

So my questions: How can I do the above? or, Is there a better way to do this?

On a side note, I have yet to receive any email in my yahoo account that has been sent from my server account. I suspect a spam filter somewhere is having a great time, but it would be nice if there were a way to diagnose this as well.

share|improve this question
    
iirc postfix default configuration does this already(relay only for trusted networks, accept mail for local domains from everywhere) - unless you fiddled around with restrictions this should work out of the box. have you tried it and something didn't work as expected? –  Gryphius Apr 11 '13 at 5:48
    
Make sure to set an MX record, and have RackSpace set up reverse DNS to your domain to help aid against being marked as spam –  David Houde Apr 11 '13 at 5:58
1  
The way to diagnose problems with sending mails is to look in the maillogs on your server. That should always be the first thing you do. –  Jenny D Apr 11 '13 at 6:34

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.