Forum Discussion
swo0sh_gt_13163
Altostratus
Jun 25, 2014Allow inbound email only for a specific Domain for SMTP VS- iRule?
Hello Folks,
Can anyone help me by sharing an iRule which only allows if the receiver email address contains my company name? Can I extract RCPT details and control allow / disallow based on the...
swo0sh_gt_13163
Altostratus
Jun 28, 2014Dear Kevin,
Thank you very much. Do you think following, the smaller version would work to achieve the requirement? I made it before I received this one.
when CLIENT_ACCEPTED {
set cto ""
set cdata ""
}
when CLIENT_DATA {
set cdata [TCP::payload]
if { [string match -nocase "RCPT TO:*" $cdata] } {
set cto [TCP::payload]
set fromaddr [regsub -all \[\\r\\n\\s\] $cto ""]
set toaddrs [findstr $toaddrs ":" 1]
set todomain [findstr $toaddrs "@" 1]
if { [ class match $todomain equals "MailAddrList" ] } {
log local0. "Email Accept based on the receipeint email address"
TCP::payload replace 0 0 $cto
TCP::release
TCP::collect
else {
}
drop }
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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