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

using multy-conditional filters (if/then/ELSEIF/else)

Hello,

I need to create multiple policies for adding disclaimers.
We have a default disclaimer and now two unique ones for domains that need to maintain their own.
I created text recourses for all disclaimers and like to make a content filter that does the following:
if the senderdomain = UniqueDomain1 then
add disclaimerDomain1
Else if the senderdomain = UniqueDomain2 then
add disclaimerDomain2
Else
Add default Disclaimer


I created the following filter syntax:

add_disclaimer: if (recv-listener == "relay") AND (mail-from == "^.*@domain1\\.com$") 
{add-footer("domain1Disclaimer");}
elif (recv-listener == "relay") AND (mail-from == "^.*@domain2\\.com$")
{add-footer("domain2Disclaimer");}
elif (recv-listener == "relay")
{add-footer("defaultDisclaimer");}


When I submit the filter I get the error "An error occurred during processing: Syntax error at the end of filter".

Does anyone know if Ironport filters support the Python "elif" routine? if so, what am I doing wrong, if not..... does anyone have any suggestions what way I can deliver this functionality?

Thank you!

Steven

4 REPLIES
New Member

Re: using multy-conditional filters (if/then/ELSEIF/else)

You can probably get the IF/ELSE IF/ELSE logic to work on the Ironport message filters, but I would suggest that you use a combination of Outgoing mail policies and outgoing content filters.

1. Create all your different disclaimers in the [Mail Policies > Text Resources] section.


2. Create a corresponding outgoing content that pertains to each sender domain and assign the outgoing content filter.

i.e.

Let's say you have two domains and then the default domain:

domain1, domain2, default domain


if "mail-from" ends with "@domain1"

then

apply domain1-disclaimer-footer
deliver();


if "mail-from" ends with "@domain2"

then

apply domain2-disclaimer-footer
deliver();


if "mail-from" ends with "default-domain"

then

apply default-disclaimer-footer
deliver();


3. Then go to your outgoing mail policies > default policies > content filters and enable all three filters.


-------------

Similarily, you can create two additional customized outgoing mail policies and each policy can have it's own outgoing content filters.

-------------

Bottom line, you can definitely do it with message filters, but the outgoing mail policies/outgoing content filters may be easier to maintain.

Let me know if you have any questions or concerns.

apply domain2-

Hello,

I need to create multiple policies for adding disclaimers.
We have a default disclaimer and now two unique ones for domains that need to maintain their own.
I created text recourses for all disclaimers and like to make a content filter that does the following:
if the senderdomain = UniqueDomain1 then
add disclaimerDomain1
Else if the senderdomain = UniqueDomain2 then
add disclaimerDomain2
Else
Add default Disclaimer


I created the following filter syntax:
add_disclaimer: if (recv-listener == "relay") AND (mail-from == "^.*@domain1\\.com$") 
{add-footer("domain1Disclaimer");}
elif (recv-listener == "relay") AND (mail-from == "^.*@domain2\\.com$")
{add-footer("domain2Disclaimer");}
elif (recv-listener == "relay")
{add-footer("defaultDisclaimer");}


When I submit the filter I get the error "An error occurred during processing: Syntax error at the end of filter".

Does anyone know if Ironport filters support the Python "elif" routine? if so, what am I doing wrong, if not..... does anyone have any suggestions what way I can deliver this functionality?

Thank you!

Steven

New Member

Re: using multy-conditional filters (if/then/ELSEIF/else)

Hi Kluu,

You are fully right with your suggestions. After reading my own post again I think I would have advised a similar thing to myself. :?

But..... I forgot two important details. :oops:

We are adding the "normal" disclaimers on our internal mail systems. The Ironports need to add disclaimer only to the messages send from (web)servers in our DMZ. We created a dedicated listener for that and the traffic entering the system over that specific listener is the only traffic we want to add disclaimers to. Even stronger: We need to be sure that every message entering the system over that listener is tagged with a disclaimer.

Besides that, are we running about 150 domains and 148 of them use the same default disclaimer, the other two need a unique one.

I was reading another post about disclaimers on this forum that works by the sake of adding (and checking) an X-header. I could do a similar thing for this problem but to me that solution seems to be more a work around than a real solution. (Which will work excellent I think)

Anyone any ideas?

Steven

New Member

Re: using multy-conditional filters (if/then/ELSEIF/else)

If these webservers in the DMZ are "relaying" mail, then they will match on the "Mail Policies > Outgong Mail Policies".

If these two domains only represent 2% of your total traffic, I would recommend that you use the outgoing mail policies to separate their flow of traffic from the normal flow.


What I would recommend is to create customizied outgoing mail policies for these two domains.

In the outgoing mail policies, add new domain where the sender is from one of those domain. Do the same for the 2nd domain. then create an outgoing content filter that adds to specific disclaimer only for that domain. I wouldn't jam everything in the default outgoing policy is those disclaimers if those two unique domains only represent 2% of your outbound traffic.




Hi Kluu,

You are fully right with your suggestions. After reading my own post again I think I would have advised a similar thing to myself. :?

But..... I forgot two important details. :oops:

We are adding the "normal" disclaimers on our internal mail systems. The Ironports need to add disclaimer only to the messages send from (web)servers in our DMZ. We created a dedicated listener for that and the traffic entering the system over that specific listener is the only traffic we want to add disclaimers to. Even stronger: We need to be sure that every message entering the system over that listener is tagged with a disclaimer.

Besides that, are we running about 150 domains and 148 of them use the same default disclaimer, the other two need a unique one.

I was reading another post about disclaimers on this forum that works by the sake of adding (and checking) an X-header. I could do a similar thing for this problem but to me that solution seems to be more a work around than a real solution. (Which will work excellent I think)

Anyone any ideas?

Steven

New Member

Re: using multy-conditional filters (if/then/ELSEIF/else)

Hello Kluu,

You are fully right!
I lived under the impression that I could not specify the receiving listener as a condition. Solving this by the GUI is the right way to do this.
Thanks for opening my eyes!

Steven

408
Views
0
Helpful
4
Replies
CreatePlease to create content