You are not logged in.
I admit that I am pretty much clueless when it comes to setting up a mail server.
The setup:
I have a local network at home with about 5 computers. Inside the network we have a router, a store-brought one that has bulit in DSL modem and wireless. It is out central DNS server and provides us with a local network domain name. Then we have a domain for the outside world to see us. Let's just call it "shadow.dot.com". I opened up the ports on the router to allow in port 80 and all POP3 addresses. I installed apache, php, mysql, and postfix on my Linux machine. I used webmin to configure postfix. Users can recieve emails, let's say from my hotmail account to user@shadow.dot.com. However, when I use webmins view usermail feature fromt he postfix area, I click on a user, then compose but my home local domain is listed instead of my shadow.do.com domain. I had in the configuration to place that outside domain in the address. Well, either way, I cannot send a message. It remains in the message queue and refuses to send.
I do not have smtp ports open because I want this secure. I only want to be able to send email from inside my local network. This way there is no chance at someone hacking my smtp part and sending tons of email spam with my address.
For this setup, what do I need in my main.cf configuration file? Can someone just put all the options in there that I need so I can copy and paste for the most part? I need to be able to send out, and I also need PHP to use it to send email to people. Do I need to unblock smtp? Do I need to change any settings with PHP or will it use postfix by default?
Thanks.
Offline
I can't help you with the main.cf file, but...
I would just use the default settings. if you want to make the smpt server secure use a combination of secure authentication and file wall.
Block incoming request for the smpt port that do not originate on the local network, maybe even have your browser block all incoming request for this port two. That should keep any outside person from using your smpt server. Another option is to require authentication to send email, this is how most ISP's and email hosting companies set up there smpt programs. The authentication is easy to set up, client side, and shouldn't be that hard on the server side.
What distro is your server? most server distributions are easyly setup. i know ubuntu makes a server distro (though i think its more amied towards a web server), opensuse might have some these options. Engarde Secure Linux (a distro i work for) would configure a lot of this for you.
Last edited by danboland (2007-04-05 16:47:22)
Daniel Boland
danboland.com
The Feynman Problem Solving Algorithm: 1) Write down the problem. 2) Think very hard. 3) Write down the solution.
Offline
I am using Arch Linux. I just used pacman to install the packages.
I do have the home firewall blocking all ports except http and POP3, so only inside access can be made to the smtp server.
The thing is, I can recieve email when testing it, but I can't send it. It just stays in the message queue. My internal IPs and domain are completely different than what the outside world sees. The outside world only knows that shadow.dot.com is the address of the web and mail server. Inside the nlocal network, all the computers have a local name. Could this be the issue? When I try to send an email it is trying to send it via shadow.dot.com rather localname? In that case, it could never access shadow.dot.com since it is firewalled on that port from the outside world.
Offline
Do your ISP give you dynamic or static ip? If dynamic, you should relay your mail through the ISP because most mailservers are configured to ignore mail from dynamic ips (spamprevention).
If you block port 25, how can people from the outside your firewall send you mail?
Post the maillog.
Sebastian A. Liem
Offline
What do you mean by staying in the queue mean? In other words, is it trying to send it, but you get an error or does it not even attempt to send the mail?
If there is an error in the log files then past it. if it is not even attempting to send it then double check your configuration.
Dan
Daniel Boland
danboland.com
The Feynman Problem Solving Algorithm: 1) Write down the problem. 2) Think very hard. 3) Write down the solution.
Offline
There is a send mail queue that is viewable via webmin. I don't know if it errored or not, it just stayed in the queue and never sent.
I uninstalled postfix and then reinstalled it with default configs again. I modified a few settings to reflect my outside domain. Then I set up sasl to log into my ISPs mail server. Not mail sorta sends.
Some PHP scripts still have trouble with it. I guess I need to fix those manually because some PHP scripts work and some don't so it might be an error with the script itself.
Mail is only sent via smtp via port 25, not recieved. Recieving port is in the one hundreds. That is the only port needed to be open for recieving of mail. ![]()
Thanks for you tips. I have I dynamic IP so liem clued me in on what to do. I don't know if it was a combination of bad config and dynamic IP, but it sorta works now, so I guess have more tweaking to do.
Offline
There is a send mail queue that is viewable via webmin. I don't know if it errored or not, it just stayed in the queue and never sent..
You don't have shell access? I don't know how postfix store it's logs (I'm a sendmail user) but it should be in /var/log.
Mail is only sent via smtp via port 25, not recieved. Recieving port is in the one hundreds. That is the only port needed to be open for recieving of mail.
You mean, port 587/tcp for mail submission as per RFC 4409?
Glad to help.
Last edited by liem (2007-04-08 08:02:01)
Sebastian A. Liem
Offline