Migrated to MikroTik hEX.
Problem is to set up correct NAT rules for internal AND external mail servers.
- we are using Gmail with mail clients (i.e. Thunderbird - POP3 995; SMTP 465) plus some other servers/clients with POP 993
- we also have an internal email server on LAN 192.168.1.x and file sending via SMTP relay
- as far as we have internal server with services we want to use from inside and from outside, we have created rules for Hairpin 2 NAT. Still I think this rule should not make a problem for mail server. Am I right?
add action=masquerade chain=srcnat comment="Local to local NAT" dst-address=192.168.1.0/24 out-interface=bridge src-address=192.168.1.0/24
add action=dst-nat chain=dstnat comment="Hairpin to 2" dst-address=!192.168.1.0/24 dst-address-type=local dst-port=yyyy-yyyyy protocol=tcp to-addresses=192.168.1.X
At the moment SMTP rule looks like
add action=dst-nat chain=dstnat comment="Mail SMTP" disabled=no dst-port=25,587 protocol=tcp to-addresses=192.168.1.X
The problem is that sending mail via LAN SMTP server it comes back with
Diagnostic-Code: X-Postfix; mail for smtp.zz.com:25 loops back to myself
What would be correct rules to get working both email servers?