This is DNS and public/private IP addresses.
your company DNS is telling the world that remote.company.com is where your email server is located. Internally your company DNS is telling the internal network that the mail server is located at mail.company.com or remote.company.com. What you refer to 1.2.3.4 is a public IP address the world can see, but 5.6.7.8 is a private IP address that only your network can see (most likely 5.6.7.8 is something like 192.168.x.x or 10.5.x.x).
This Mountain Lion issue is changing the mail setting to the internal server name (mail.), even if you put in the public name (remote.). Since mail. is not publicly published via DNS you can never connect when outside the network, Mountain Lion shoud not be making this change. If you put in remote. in the setting, it should stay as remote. and not be changed everytime you connect to the server.