small question about mail clients on same network as mail server
i have postfix/courier-imap running on a local server on my home network. it is behind a router which has a static IP registered with the domainname for which the mail server operates. normally, i would just configure mail clients to use domain.com for the SMTP & IMAP servers, which resolves to this network's external address. since i've forwarded the right ports, this works everywhere in the world, except for on this network, which IS the domain.com network.
the end result is that I have to reconfigure all of my mail clients to use the local email server's IP, and change it back to domain.com whenever I leave here. i've looked around in thunderbird, iOS mail and the android mail client; all of them can use multiple SMTP servers which solves this problem (domain.com as the first, local server IP as the second), but none of them can do this with IMAP.
this seems like it should be easy to get around, maybe by having the local DNS server return a different domain.com MX record ONLY for clients on the LAN that points to the local mail server? or playing with iptables on the router?