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.