How to setup a incoming mail server behind a dynamic IP?

jrbryner

[H]ard|Gawd
Joined
Feb 6, 2001
Messages
1,530
I'm trying to setup my local webserver to accept incoming mail. After a few hours, I got Postfix setup relay to my ISPs SMTP server to send mail out, but what do I need to do to set it up so I can send email TO my server? I have a dynamic DNS service setup through no-ip.org, but far as I know, doesn't that just work for HTTP? I also have a Linksys router that routes the port 25 to my local computer.
OS is Ubuntu, using Postfix. New to configuring Postfix as of today, so anything simple would help :)
 
you need to set your MX record for your domain to your no-ip.com IP. I do this for my backup email server.
 
I don't have a domain name, I was just using something like http://[myname].no-ip.org to access my webserver. So, to get an MX record, I need a domain name, correct? So if I do that, I set my DNS servers to my no-ip.org account?
 
well, I just locked myself out of my no-ip.com account, but I want to say there is a field where you can have an MX record where you manage your IPs.
 
There's a section for MX records when I modify my host, but it asks for a hostname, not an IP address. Dunno what I should put there then...
 
The hostname it wants is the hostname of the email server (most likely, your hostname.no-ip.org) that you want your mail to go to. It will look up what the IP address is.
 
Ok, did that. So to send a mail to myself, I just email [username]@[myname].no-ip.org? I tried that, and typed 'mail' at the console, and nothing new came in.

I have port 25 pointing to that computer on my router. Is there a way to check if the message is actually getting to that computer? I looked in the mail.log file for Postfix and (with my limited knowledge of it) I didn't see any record of a message sent to the address I sent it. There's a lot of postfix/pickup - postfix/cleanup - postfix/smtp messages. And it looks like maybe a couple rejected spam messages.
 
if you tried sending the mail shortly after modifying the no-ip.com record...it may not have had enough time to propogate out to your dns/smtp server. try it later on tonight.
 
Na, I changed the setting yesterday and tried a couple times last night, and again this morning. No go :(
 
1) test your mx record

using the dig tool from the command line:
Code:
dig hostname.no-ip.com
This verifies that you have the right IP address. The ANSWER flag up top should have a number greater than or equal to 1 there.
Code:
dig mx hostname.no-ip.com
This verifies that the MX record that you get in the ANSWER section is the one you configured. If both ANSWERS come back with the right hostnames and ip's, your DNS configuration is good to go.

2) Make sure your ISP doesn't block port 25.

From an external host, telnet to port 25 of your hostname.no-ip.org. If you can't telnet to it from OUTSIDE your router, they're blocking your port and there's really nothing you can do about that. When you've telnetted into your box, you can run something like the command sequence at http://www.qmailrocks.org/start_qmail.htm (scroll down to the telnet localhost 25 part). If after you do the "ehlo localhost" part and you get a bunch of 250 lines you're on the right track.

3) You might need a valid reverse DNS entry for your hostname for sendmail to work. I don't remember if this is the case or not, or if you can reconfigure sendmail to not require a reverse DNS entry. If the top two issues aren't the problem, try searching the net for sendmail and reverse DNS for more information.
 
That dig tool helped. It came back with Answer: 0. Realized that I hadn't checked that the IP address on no-ip.org was going to the right IP, which it wasn't. I updated that and finally! got a message through. Thanks a ton!

Next question, how can I reject all messages except to one or two users? Trying not to be a springboard for spammers.
 
Back
Top