Local ip -> router local ip -> router public ip -> router local ip -> mail server local ip. I'm not surprised my cheap ISP supplied router does not handle this very well.
The solution is to have a DNS server on the local network that will give the local ip for my mail server for all local requests of my dynamic hostname. For this I use DNSmasq.
apt-get install dnsmasq
In /etc/hosts make sure that there is an entry for your servers local hostname using the local ip:
In /etc/resolv.conf set your ISPs DNS servers or use Google public DNS or OpenDNS.
In /etc/dnsmasq.conf set something like:
#return addresses from hosts file with correct local address matching incoming interface
#proxy authentication flag
# Never forward plain names (without a dot or domain part)
# Never forward addresses in the non-routed address spaces.
# Add other name servers here, with domain specs if they are for
# non-public domains.
# Add domains which you want to force to an IP address.
# disable DHCP and TFTP
Now either set your devices to use your new DNS server or adjust your router to hand out the new DNS setting automatically.