OK, here's my setup: I have a Debian box that acts as a mail and file server in my LAN (one day it will do more, but that's already enough for now). I use it to sync all my computers' main directories, and it also collects (via fetchmail) my mail from my various accounts, so my work computers have their mail clients pointing to my server, and they all get the mail from everywhere.

Now, the problem is to access the server in one way only, whether I am on the LAN or I am out in the wild. Right now, I use hamachi, and it allows me to use their VPN whether I am in or out of my LAN (it's a bit strange to use it from within the LAN, but the point is that it works).

I would like to wean myself from hamachi and use my dynamic DNS address, and port-forwarding (which is active for POP and SSH, for now) to do the same. The problem is that trying to access my public IP from within my LAN does not work, and if I use my LAN address when I am in, and my public IP when I am out, all my computers think I am accessing a different server, so my mail get downloaded twice to my mail clients, which is both a waste of time, and of space.

Is there some kind of workaround for this that is escaping me? Basically, I believe, I would need my mail clients to be able to query my POP server from inside the LAN using the public IP, or something that would emulate this behavior.

This is quite simple to do, if you are running a local DNS server (and if you are not, read the dnamasq tutorial in LXF 170).

All you do is add the mail server's hostname, along with its LAN IP address to /etc/hosts on the box running dnsmasq. That way the hostname will resolve to the LAN address when at home and the public address when out and about.

That's exactly what I do here, and its worked well for many years.

"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)

Thanks! I waited until I got LXF 170 in the mail (I downloaded the PDF version, but I am lazy about reading on a screen )

Just one question (which I should be able to answer myself by experimenting): is it OK if the computer running dnamsq and the mail server are one and the same? I would think so, but I might be missing something.