For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

keith_varga_107's avatar
keith_varga_107
Icon for Nimbostratus rankNimbostratus
Sep 24, 2015

Geo-specific SMTP mail routing

Hi F5 Team,

 

We are faced with a new geo-specific enabled SMTP requirement for one of our applications.

 

When sending mail into our system, we need the customer to be directed to an appropriate SMTP server based on their global location.

 

This is what we are hoping is possible:

 

A customer in Canada sends a mail to our application, and DNS routes the inquiry to our F5 in Pittsburgh.

 

F5 in Pittsburgh cross-references the Canadian customer's IP address against a massive table of all IPs and their geolocations, and finds the IP in Canada.

 

Then, the F5 returns the MX record of our mail server in Canada to the customer.

 

Thanks much,

 

Keith

 

2 Replies

  • I assume you have a GTM? Obviously the only source IP that the GTM will see is the IP of the resolving DNS server, rather than the IP of the mail client. Try this (warning totally untested.....) attached to the GTM listener ;-

    when DNS_REQUEST {
          if { ([DNS::question type] eq "MX")  &&  ([string tolower [DNS::question name]] eq "varga.com")} {
             DNS::answer clear
             switch [whereis [IP::client_addr] country] {
                "CA" {
                     It's Canada
                    set rr [DNS::rr "mxca.varga.com" 1440 IN MX "100 144.100.1.1"]
                }
                "US" {
                     It's the USA
                    set rr [DNS::rr "mxus.varga.com" 1440 IN MX "100 150.100.1.1"]
                }
                default
                     It's the world.....
                    set rr [DNS::rr "mx.varga.com" 1440 IN MX "100 154.100.1.1"]
                }
    
             }
              DNS::answer insert $rr
             DNS::header aa 1    
             DNS::return
          }
    }
    
    • keith_varga_107's avatar
      keith_varga_107
      Icon for Nimbostratus rankNimbostratus
      thanks much iheart. We were just quoted $30,000 for two GTM's from F5 sales. However, we don't have that cash laying around, so we're going to build a linux server with bind, and use a free plugin to get it done. Thanks Keith