Forum Discussion
Scott_Albrech_8
Nimbostratus
Feb 03, 2005regexp looking for email addresses in iRule
Toying with some stuff and thought I'd like to scan TCP payload for email addresses, preferably in the "MAIL FROM", but I'm starting much bigger for sake of easing into this. Anyhoo, not having much ...
unRuleY_95363
Feb 04, 2005Historic F5 Account
I'm not sure what your ultimate goal is, but here is a very simple example rule that will scan for something (like an e-mail address) in a connection and reset it if found (however, it will not find strings that span TCP packets, but this should not be a problem with most SMTP clients):
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
if { [TCP::payload] contains "joe@foobar.com" } {
reject
} else {
Release the current payload onto the server
TCP::release
But still collect the next data from the client
TCP::collect
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects