Forum Discussion

Chris_Olson's avatar
Chris_Olson
Icon for Nimbostratus rankNimbostratus
May 27, 2020

Redirect mail traffic

We are moving Data centers. There will be a period of time where we may want to redirect mail traffic. We can used DNS but that takes time to propagate. I have used multiple irules for URL and http traffic but not for mail traffic. I don't know if F5 has the right operators for SMTP.

 

Basically, all traffic coming in over 995 and SMTP should be redirected to the new mail server in the new data center. I thought about replacing when http request with when "client_accepted" then maybe use string parameter but they all use to "http" too. Is there a way to direct all my mail server traffic to the new domain. Obviously, my mail servers already site behind the F5.

 

ltm rule mail_redirect {

  when CLIENT_ACCEPTED {

  if { [string tolower [HTTP::host]] equals "mail.olddomain.com" } {

 # redirect to mail.newdomain.com

}

 

  • I would configure this with MX records.

     

    MX 10 mail.olddomain.com

    MX 20 mail.newdomain.com

     

    Disable the virtual server for mail.newdomain.com until the migration.

     

    Mailservers will first try MX 10 to send the email. If it is not responding they will send it to the next MX record in the list.

     

    When you start the migration enable the virtual server for mail.newdomain.com and disable the virtual server for mail.olddomain.com

     

    Sending mailservers will automatically start sending mail to mail.newdomain.com.

     

    Cheers,

     

    Kees