Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 

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 {


  if { [string tolower [HTTP::host]] equals "" } {

 # redirect to




I would configure this with MX records.


MX 10

MX 20


Disable the virtual server for 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 and disable the virtual server for


Sending mailservers will automatically start sending mail to