cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
1072
Views
0
Helpful
1
Replies

MessageFilter Rule

sameerade
Level 1
Level 1

Hello,

Am trying to setup a message rule which will allow emails to perticular domains and drop anything going outside from perticular IPs. Here is what I have and its not working. Please help...

CDW_Filter:

if(((remote-ip == '10.17.239.11') OR (remote-ip == '10.17.239.254')) AND ((rcpt-to != 'internal1.local') OR (rcpt-to != 'internal2.local')))

{

    drop();

}

It drops anything coming from those IPs.

1 Reply 1

Andreas Mueller
Level 4
Level 4

Hello Sameer,

the error is your second statement, if you think for a moment,  this is always true:

((rcpt-to != 'internal1.local') OR (rcpt-to != 'internal2.local'))

You need to use AND to make it working

((rcpt-to != 'internal1.local') AND (rcpt-to != 'internal2.local'))

BTW, another way to check for IPs is to create a sendergroup with the servers you want to enforce this filter with, and then match on the sendergroup  rule rather than a list of IPs. This way the filter becomes easier to mantain, as you can add and remove IPs in the sendergroup on the GUI without changing the filter.

Hope that helps,

Andreas