Just to set up the environment for you guys (or gals), I'm running a Cisco ASA 5520 Firewall and I've got my web server:
*All domains and external IP's are bogus but lets assume they're valid for the time being.*
And my mail server:
Both my mail and web server sit on the same DMZ interface behind the Firewall. I'm having problems sending webmail from the web server because when my www server connects to mail, it does so as the external IP rather than the trusted internal IP. My mail server only relays mail from trusted networks and that's only 192.168.0.0/24.
Jan 6 12:51:54 mail dovecot: imap-login: Login: user=<carlos>, method=PLAIN, rip=18.104.22.168, lip=192.168.0.200, mpid=4656, TLS
Jan 6 12:51:55 mail postfix/smtpd: warning: 22.214.171.124: address not listed for hostname www.somedomain.tld
Jan 6 12:51:55 mail postfix/smtpd: connect from unknown[126.96.36.199]
Jan 6 12:51:55 mail postfix/smtpd: setting up TLS connection from unknown[188.8.131.52]
Jan 6 12:51:55 mail postfix/smtpd: Anonymous TLS connection established from unknown[184.108.40.206]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Jan 6 12:51:55 mail postfix/smtpd: disconnect from unknown[220.127.116.11]
Jan 6 12:51:55 mail dovecot: imap(carlos): Disconnected: Logged out bytes=12/341
So I don't understand why the rip (requested IP) is my external NAT IP rather than my internal 192.168.0.201 IP address. They're both on the same network / subnet so why is my web server going out and back into the Firewall? This makes no sense to me. My mail server doesn't trust the external NAT IP but rather the internal 192.168.0.0/24 subnet. I've check DNS and rDNS and they're all correct. I've added local host entries in my mail server for the web servers 192.168.0.201/24 IP. Anyone know what's going on here?