Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

SMTP Proxy

Problem this snippet solves:

This iRule implements a simple SMTP proxy. This is just to show an idea to relay smtp message and to route mail traffic based on FROM or TO... this rule is tested and work with one default pool and basic smtp client.

Comments on this Snippet
Comment made 2 weeks ago by F5_Jeff 331

Hi,

We are also constructing iRule which will direct traffic on a specific pool if an email was received from "gmail.com" or "google.com"

here is our script:

when CLIENT_ACCEPTED {
  log local0. "Client_ACCEPTED_HIT: IP address:[IP::client_addr]"
  TCP::respond "220\r\n" 
  TCP::collect
} 

when CLIENT_DATA { 
  log local0. "Client_DATA_HIT: IP address:[IP::client_addr] Data: [TCP::payload]"
  if { [TCP::payload] contains "gmail.com" } {
      pool testtesttest
      log local0. "cdata_FOUND: IP address:[IP::client_addr] Dest IP:[server_addr]:[server_port] Data: [TCP::payload]"
   }
  TCP::release
  TCP::collect
}

The issue we are having is that, the traffic is not being directed to the specified pool but to the default pool. however, the log "cdata_FOUND:.." can be seen. This mean that the traffic satisfied the "if condition".

This is where we are lost.

0