Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

Writing Message Filters Script via CLI

Is there any document to refer while writing scripts for message filters?

My ESA is on version 8.0.1 and I am unable to make text "case insensitive" while checking that text under "contains" rule? Is there any mechanism to look for text by ignoring the case?

Cisco Employee

using (?i) in either message

using (?i) in either message or content filter will allow case insensitivity to be used.


subject == "(?i)\\[SEND SECURE\\]” 

* Q: What does (?i) do?  Case insensitivity.  Allows for “[SEND SECURE]”, “[send secure]”, “[SeNd SeCuRe]”, etc.

See either the Email Security End User Guide, or the older Advanced Configuration Guide - and look for the "Using Message Filters to Enforce Email Policies" section for full information and examples!

I hope this helps!



(*If you have received the answer to your original question, and found this helpful/correct - please mark the question as answered, and be sure to leave a rating to reflect!)

New Member

Hi Robert,Thanks for your

Hi Robert,

Thanks for your help. However, while I select "contains" as parameter check rule instead of "begins" or "ends", the case insensitivity (?i) doesn't work. Is there any limitation for "contains" parameter rule check?

Cisco Employee

Can you provide me what your

Can you provide me what your filter is?  Screenshot, or CLI output?

New Member

Robert, Here is the script



Here is the script


Blacklist_Sender_MF: if (recv-listener == "ExternalMail") AND (mail-from == "(?i)") {

CreatePlease to create content