This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sending all SMTP traffic intended to any public IP to a single private IP

I am setting up a virtual lab to test internally developed custom SMTP client. In order to simulate SMTP traffic without hitting the actual mail servers (e.g. google, aol, yahoo, etc…) I would like to achieve the following setup using SOPHOS UTM firewall: An SMTP client in the virtual lab will initiate SMTP communication to a public IP address (the IP address of the MX server, e.g. MX Server for google.com or aol.com). Instead of the communication actually going to the public IP address, I would like the traffic to go to the internal IP address of the SMTP server in the virtual lab which will simulate processing incoming requests. I was able to setup a rule, using the "Full NAT" option, to achieve this redirection per one public IP, but I would like to setup a "catch-all" redirection, where all SMTP communication to any public IP will be redirected to a single private IP.

How can it be done with SOPHOS UTM 9.3?


This thread was automatically locked due to age.
  • You'll have to make multiple NAT-rules, one for every public IP-address.
  • I was already able to create one rule per public IP using Full NAT, but I need to do it for thousands of public IPs.

    Is there a way to setup a "catch all" that any SMTP communication to any public IP will end up being sent to and processed by an SMTP server listening on a single private IP?

    Just to clarify both the SMTP client and the SMTP server are in the same virtual environment and if needed can also be setup on the same machine.
  • I think that could be easily solved without UTM involvement, by building internal DNS server with root zone authority and MX wildcard record in it.

    Are there any reasons that SMTP test traffic have to pass the UTM ?
  • The SMTP client is using an optimization algorithm based on the IP addresses of the resolved MX records.  So if all MX records will resolve to a single private IP, it will skew the tests.  This is why the type of solution that will resolve the MX records of any domain to a single IP will not work for the test.

    To be able to run a valid test the process flow has to remain the following:

    1. SMTP Client starts processing a destination Email Address
    2. SMTP Client acquires the IP addresses of the MX records for the domain
    3. SMTP Clients initiates communication to the acquired IP - The communication goes to the single private IP, instead of the acquired MX record IP.

    This way the client still thinks that it communication to bunch of different IP, so the optimization algorithm will work correctly.
  • Forgot to mention that SOPHOS UTM is not a hard requirement.  Initially I thought that it has a built-in support for what I am trying to accomplish.
  • Hi, univertex, and welcome to the User BB!

    I may not be following your explanation well enough to "see" the situation correctly...

    If you configure the SMTP Proxy, it will "listen" to all IPs on all interfaces that have a default gateway.  You can disable all of the anti-spam, anti-virus, etc. to create just a forwarding mechanism.

    Cheers - Bob
  • I would like to setup a "catch-all" redirection, where all SMTP communication to any public IP will be redirected to a single private IP.
    How can it be done with SOPHOS UTM 9.3?


    Simple DNAT rule?