Forum Discussion
Using an iRule for SMTP Relay and Exchange 2013
Good morning, I'm trying to use the following iRule to enable my LTM (running v11.1) to play SMTP relay for our new Exchange 2013 servers (see below), yet getting an error (also below). I don't have much iRule/Scripting experience, so understanding where the syntax issue is has proved challenging. Any help is greatly appreciated.
iRule
when CLIENT_ACCEPTED { set accepted_snat "IP Address"
if { [ class exists smtp_relay_allowed ] } { if { [class match [IP::client_addr] equals "smtp_relay_allowed"] } { snat $accepted_snat } else { snat automap } } else { snat automap } }
Error in Local Traffic log
TCL error: /Common/o365-smtp-relay_irule - can't read "::smtp_relay_allowed": no such variable while executing "class match [IP::client_addr] equals $::smtp_relay_allowed"
Thanks!
Jeff B
2 Replies
- John_Alam_45640Historic F5 Account
There is a difference between the irule you posted and what is reported in the TCL error.
Nonetheless, It appears that smtp_relay_allowed is supposed to be the name of a data-group defined via the GUI. If so, use it without the ''$::' and without surrounding it by quotes.
when CLIENT_ACCEPTED { set accepted_snat "IP Address" if { [ class exists smtp_relay_allowed ] } { if { [class match [IP::client_addr] equals smtp_relay_allowed] } { snat $accepted_snat } else { snat automap } } else { snat automap } } - Jeff_Bull_42197
Nimbostratus
Thanks John. Sorry about that, must have pasted a slightly different version of the iRule. I'll give your suggestion a try and see how it goes.
Jeff
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
