Forum Discussion
iRule to modify SMTP mail content
Hi, We have an requirement, where in we need to inspect the incoming SMTP message, look for a particular string and based on that modify the mail content. I have written the below iRule but this is not working. The CLIENT_DATA event is being triggered. I refered to the SMTP proxy iRule provided in this link(https://devcentral.f5.com/wiki/iRules.SMTPProxy.ashx?NS=iRules). I am not sure if i am missing anything here.
when CLIENT_ACCEPTED {
TCP::respond "220\r\n" TCP::collect 2000 } when CLIENT_DATA { set cdata [TCP::payload] if { $cdata starts_with "DATA" } { if { [string match "Exchange2010R2" $cdata ]} {
string map {"Sent From:" "Sent From:\nExchange 2010 R2 Server\n"} TCP::payload
}
} TCP::release TCP::collect }
Thanks in Advance. Ajay
15 Replies
- pi11_72182
Nimbostratus
Hi Ajay; would you be able to post an example snipplet of how you ended up using STREAM_MATCHED to solve this problem?
I would like to solve a very similar problem: I am trying to route the message to different pool based on certain keyword(s) in the subject of the email message.
Thanks in advance
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