Fabrizio_Chiava
May 03, 2013Nimbostratus
iRule for email Traffic SMTP port 25
Hi,
I need some help to configure an iRule based on the email domain name. So, I have a customer that balance the Sophos's outbound traffic (SMTP port 25). Unfortunately some email tagged as SPAM are NOT SPAM. So, the client needs to unlock this email to appliance, but all traffic flows to BIGIP.
I would that iRule behaves in this way:
if (Domain = @example.com) -> forward to node
else pool_default
Could you help me, please?
I'm basing to this iRule, I think it's a good way to approach to the solution:
when RULE_INIT {
Replace this test TCL list with a "string" type datagroup
and then delete the RULE_INIT event
set destination_translations_class [list \
"10.2.135.100:80 192.168.135.100:8080" \
"10.2.135.101:8080 192.168.135.101:8888" \
]
}
when CLIENT_ACCEPTED {
log local0. "[IP::client_addr]:[TCP::client_port]: New TCP connection to [IP::local_addr]:[TCP::local_port]"
Look up the destination address:port in a datagroup
set dest [findclass [IP::local_addr]:[TCP::local_port] $::destination_translations_class " "]
log local0. "[IP::client_addr]:[TCP::client_port]: Matched \$dest: $dest"
Check if there was a match
if {$dest ne ""}{
log local0. "[IP::client_addr]:[TCP::client_port]: Using node [split $dest ":"]"
Set the destination IP and port using the node command
node [split $dest ":"]
}
}
Thanks a lot
Best regards
Fabrizio.